fix tests

This commit is contained in:
Andrew Gallant
2016-09-16 06:58:10 -04:00
parent 0e46171e3b
commit 8203a80ac7
3 changed files with 6 additions and 7 deletions

View File

@@ -61,11 +61,11 @@ pub fn file_name<'a, P: AsRef<Path> + ?Sized>(
let mut last_slash = 0;
for (i, &b) in path.iter().enumerate().rev() {
if b == b'/' {
last_slash = i;
last_slash = i + 1;
break;
}
}
Some(OsStr::from_bytes(&path[last_slash + 1..]))
Some(OsStr::from_bytes(&path[last_slash..]))
}
/// The final component of the path, if it is a normal file.