1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 21:47:46 +00:00

Update fold to replace vector concatenation.

The syntax for concatenating a vector and a slice use the '+' operator
was removed from Rust.
This commit is contained in:
Joseph Crail 2015-05-12 16:52:15 -04:00
parent 57050517f9
commit 66a7dc8cb7

View file

@ -84,8 +84,9 @@ fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
for (i, arg) in args.iter().enumerate() {
let slice = &arg;
if slice.chars().next().unwrap() == '-' && slice.len() > 1 && slice.chars().nth(1).unwrap().is_digit(10) {
return (args[..i].to_vec() + &args[i + 1..],
Some(slice[1..].to_string()));
let mut v = args.to_vec();
v.remove(i);
return (v, Some(slice[1..].to_string()));
}
}
(args.to_vec(), None)