docs(exmaples): Fix example to better align with intended use case

This commit is contained in:
zippy-dice 2024-04-16 02:11:09 +09:00
parent a9ccb3edb5
commit d9081f3dce

View file

@ -10,5 +10,11 @@ fn main() {
)
.get_matches();
println!("name: {:?}", matches.get_one::<String>("name"));
let args = matches
.get_many::<String>("name")
.unwrap_or_default()
.map(|v| v.as_str())
.collect::<Vec<_>>();
println!("names: {:?}", &args);
}