1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (allow map_clone)

.# [why]

Although `copied()` is preffered, it was not stabilized until rust v1.35.0.
So, 'map_clone' is allowed instead of increasing MinSRV to v1.35.0.

* ref: https://github.com/rust-lang/rust/blob/master/RELEASES.md
This commit is contained in:
Roy Ivy III 2019-12-29 11:22:56 -06:00
parent 99ce03f259
commit df68c396c4
2 changed files with 5 additions and 2 deletions

View file

@ -26,7 +26,8 @@ pub fn arrnum_int_mult(arr_num: &[u8], basenum: u8, base_ten_int_fact: u8) -> Ve
}
}
}
let ret: Vec<u8> = ret_rev.iter().rev().map(|x| x.clone()).collect();
#[allow(clippy::map_clone)]
let ret: Vec<u8> = ret_rev.iter().rev().map(|x| *x).collect();
ret
}
@ -190,7 +191,8 @@ pub fn arrnum_int_add(arrnum: &[u8], basenum: u8, base_ten_int_term: u8) -> Vec<
}
}
}
let ret: Vec<u8> = ret_rev.iter().rev().map(|x| x.clone()).collect();
#[allow(clippy::map_clone)]
let ret: Vec<u8> = ret_rev.iter().rev().map(|x| *x).collect();
ret
}

View file

@ -28,6 +28,7 @@ fn usage(cmap: &UtilityMap) {
println!("Usage:");
println!(" {} [util [arguments...]]\n", NAME);
println!("Currently defined functions:");
#[allow(clippy::map_clone)]
let mut utils: Vec<&str> = cmap.keys().map(|&s| s).collect();
utils.sort();
for util in utils {