mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Change typeof Args::targets
to Option<Vec<String>>
(#327)
* Change typeof `Args::targets` to `Option<Vec<String>>` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
480ea19462
commit
b330a18d40
4 changed files with 8 additions and 5 deletions
|
@ -50,9 +50,9 @@ impl DesiredTargets {
|
|||
/// Since `detect_targets` internally spawns a process and wait for it,
|
||||
/// it's pretty costy, it is recommended to run this fn ASAP and
|
||||
/// reuse the result.
|
||||
pub fn get_desired_targets(opts_targets: Option<&str>) -> DesiredTargets {
|
||||
pub fn get_desired_targets(opts_targets: Option<Vec<String>>) -> DesiredTargets {
|
||||
if let Some(targets) = opts_targets {
|
||||
DesiredTargets::initialized(targets.split(',').map(|t| t.to_string()).collect())
|
||||
DesiredTargets::initialized(targets)
|
||||
} else {
|
||||
DesiredTargets::auto_detect()
|
||||
}
|
||||
|
|
|
@ -35,7 +35,10 @@
|
|||
//! # async fn main() {
|
||||
//!
|
||||
//! assert_eq!(
|
||||
//! get_desired_targets(Some("x86_64-apple-darwin,aarch64-apple-darwin")).get().await,
|
||||
//! get_desired_targets(Some(vec![
|
||||
//! "x86_64-apple-darwin".to_string(),
|
||||
//! "aarch64-apple-darwin".to_string(),
|
||||
//! ])).get().await,
|
||||
//! &["x86_64-apple-darwin", "aarch64-apple-darwin"],
|
||||
//! );
|
||||
//! # }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue