| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 2 | ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#, |
| 3 | pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::{Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#, PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#}, |
| 4 | processrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/::Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#, |
| 5 | }; |
| 6 | |
| 7 | /// `Tool` found by `find-msvc-tools` |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 9 | pub struct Toolrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool# { |
| 10 | pub(craterust-analyzer cargo find-msvc-tools 0.1.9 crate/) toolrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#tool.: PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#, |
| 11 | pub(craterust-analyzer cargo find-msvc-tools 0.1.9 crate/) is_clang_clrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#is_clang_cl.: bool, |
| 12 | pub(craterust-analyzer cargo find-msvc-tools 0.1.9 crate/) envrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#env.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<(OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#, OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#)>, |
| 13 | } |
| 14 | |
| 15 | impl Toolrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool# { |
| 16 | /// Converts this compiler into a `Command` that's ready to be run. |
| 17 | /// |
| 18 | /// This is useful for when the compiler needs to be executed and the |
| 19 | /// command returned will already have the initial arguments and environment |
| 20 | /// variables configured. |
| 21 | pub fn to_commandrust-analyzer cargo find-msvc-tools 0.1.9 tool/impl#[Tool]to_command().(&self) -> Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command# { |
| 22 | let mut cmd = Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]new().(&self.toolrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#tool.); |
| 23 | |
| 24 | for (k, v) in self.envrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#env..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() { |
| 25 | cmd.envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]env().(k, v); |
| 26 | } |
| 27 | |
| 28 | cmd |
| 29 | } |
| 30 | |
| 31 | /// Check is the tool clang-cl related |
| 32 | pub fn is_clang_clrust-analyzer cargo find-msvc-tools 0.1.9 tool/impl#[Tool]is_clang_cl().(&self) -> bool { |
| 33 | self.is_clang_clrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#is_clang_cl. |
| 34 | } |
| 35 | |
| 36 | /// Get path to the tool |
| 37 | pub fn pathrust-analyzer cargo find-msvc-tools 0.1.9 tool/impl#[Tool]path().(&self) -> &Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path# { |
| 38 | &self.toolrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#tool. |
| 39 | } |
| 40 | |
| 41 | /// Get environment variables for the tools |
| 42 | pub fn envrust-analyzer cargo find-msvc-tools 0.1.9 tool/impl#[Tool]env().(&self) -> impl IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item# = &(OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#, OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#)> { |
| 43 | &self.envrust-analyzer cargo find-msvc-tools 0.1.9 tool/Tool#env. |
| 44 | } |
| 45 | } |