Fix test
This commit is contained in:
parent
51d04f1a70
commit
8e87effb14
|
|
@ -38,7 +38,7 @@ impl Query {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_filename(path: &str) -> &str {
|
fn get_filename(mut path: &str) -> &str {
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
Path::new(path)
|
Path::new(path)
|
||||||
.file_name()
|
.file_name()
|
||||||
|
|
@ -46,6 +46,9 @@ fn get_filename(path: &str) -> &str {
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
} else {
|
} else {
|
||||||
|
if path.ends_with('/') {
|
||||||
|
path = &path[..path.len() - 1];
|
||||||
|
}
|
||||||
match path.rfind('/') {
|
match path.rfind('/') {
|
||||||
Some(idx) => &path[idx + 1..],
|
Some(idx) => &path[idx + 1..],
|
||||||
None => path,
|
None => path,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue