mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 06:02:36 +00:00
tidy up matches into maps
This commit is contained in:
parent
da97ee40f2
commit
7eeda6c8a2
1 changed files with 3 additions and 6 deletions
|
@ -27,12 +27,9 @@ impl Name {
|
||||||
None => path.to_string_lossy().to_string(),
|
None => path.to_string_lossy().to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut extension = None;
|
let extension = path
|
||||||
if let Some(res) = path.extension() {
|
.extension()
|
||||||
if let Some(res) = res.to_str() {
|
.map(|ext| ext.to_string_lossy().to_string());
|
||||||
extension = Some(res.to_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
name,
|
name,
|
||||||
|
|
Loading…
Reference in a new issue