mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 14:12:31 +00:00
use name as file name when file name None
This commit is contained in:
parent
f39162dba9
commit
ace04d6b39
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ impl Name {
|
|||
}
|
||||
|
||||
pub fn file_name(&self) -> &str {
|
||||
self.path.file_name().and_then(OsStr::to_str).unwrap()
|
||||
self.path.file_name().and_then(OsStr::to_str).unwrap_or(&self.name)
|
||||
}
|
||||
|
||||
fn relative_path<T: AsRef<Path> + Clone>(&self, base_path: T) -> PathBuf {
|
||||
|
|
Loading…
Reference in a new issue