mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-01-16 11:10:32 +00:00
More logging things that shouldn’t happen
This commit is contained in:
parent
a5e177afe5
commit
6fbb0b8626
@ -73,9 +73,13 @@ impl<'dir> File<'dir> {
|
||||
/// such as `/` or `..`, which have no `file_name` component. So instead, just
|
||||
/// use the last component as the name.
|
||||
pub fn filename(path: &Path) -> String {
|
||||
match path.components().next_back() {
|
||||
Some(back) => back.as_os_str().to_string_lossy().to_string(),
|
||||
None => path.display().to_string(), // use the path as fallback
|
||||
if let Some(back) = path.components().next_back() {
|
||||
back.as_os_str().to_string_lossy().to_string()
|
||||
}
|
||||
else {
|
||||
// use the path as fallback
|
||||
error!("Path {:?} has no last component", path);
|
||||
path.display().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user