We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1eea517 commit d5bfb75Copy full SHA for d5bfb75
src/uucore/src/lib/features/benchmark.rs
@@ -32,8 +32,9 @@ where
32
F: FnOnce(std::vec::IntoIter<std::ffi::OsString>) -> i32,
33
{
34
// Prepend a dummy program name as argv[0] since clap expects it
35
- let mut os_args: Vec<std::ffi::OsString> = vec!["benchmark".into()];
36
- os_args.extend(args.iter().map(|s| (*s).into()));
+ let os_args = std::iter::once(std::ffi::OsString::from("benchmark"))
+ .chain(args.iter().map(std::ffi::OsString::from))
37
+ .collect::<Vec<_>>();
38
util_func(os_args.into_iter())
39
}
40
0 commit comments