1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#[cfg(test)]
#[path = "./toolchain_test.rs"]
mod toolchain_test;
use crate::types::CommandSpec;
pub(crate) fn wrap_command(
toolchain: &str,
command: &str,
args: &Option<Vec<String>>,
) -> CommandSpec {
let mut rustup_args = vec![
"run".to_string(),
toolchain.to_string(),
command.to_string(),
];
match args {
Some(array) => {
for arg in array.iter() {
rustup_args.push(arg.to_string());
}
}
None => (),
};
CommandSpec {
command: "rustup".to_string(),
args: Some(rustup_args),
}
}