mirror of
https://github.com/lsd-rs/lsd.git
synced 2026-02-14 11:14:36 +02:00
tidy up matches into maps
This commit is contained in:
@@ -27,12 +27,9 @@ impl Name {
|
||||
None => path.to_string_lossy().to_string(),
|
||||
};
|
||||
|
||||
let mut extension = None;
|
||||
if let Some(res) = path.extension() {
|
||||
if let Some(res) = res.to_str() {
|
||||
extension = Some(res.to_string());
|
||||
}
|
||||
}
|
||||
let extension = path
|
||||
.extension()
|
||||
.map(|ext| ext.to_string_lossy().to_string());
|
||||
|
||||
Self {
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user