1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

cp: use inclusive range

as suggested by clippy::range-plus-one
This commit is contained in:
kralo 2024-01-27 23:00:14 +01:00 committed by Sylvestre Ledru
parent d046d33bee
commit ee7f99aad0

View file

@ -1622,7 +1622,7 @@ fn aligned_ancestors<'a>(source: &'a Path, dest: &'a Path) -> Vec<(&'a Path, &'a
// Get the matching number of elements from the ancestors of the
// destination path (for example, get "d/a" and "d/a/b").
let k = source_ancestors.len();
let dest_ancestors = &dest_ancestors[1..1 + k];
let dest_ancestors = &dest_ancestors[1..=k];
// Now we have two slices of the same length, so we zip them.
let mut result = vec![];