mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Minor simplification
This commit is contained in:
parent
646a41317a
commit
15bd6f9813
1 changed files with 4 additions and 11 deletions
|
|
@ -33,18 +33,11 @@ impl Manager {
|
||||||
|
|
||||||
let ext = url.extension();
|
let ext = url.extension();
|
||||||
match by {
|
match by {
|
||||||
"name" => {
|
"name" => ext.map_or_else(String::new, |s| s.to_string_lossy().to_string()),
|
||||||
return ext.map_or_else(String::new, |s| s.to_string_lossy().to_string());
|
"ext" if ext.is_some() => format!("{}.", url.file_stem().unwrap().to_string_lossy()),
|
||||||
}
|
"dot_ext" if ext.is_some() => url.file_stem().unwrap().to_string_lossy().to_string(),
|
||||||
"ext" if ext.is_some() => {
|
_ => url.file_name().map_or_else(String::new, |s| s.to_string_lossy().to_string()),
|
||||||
return format!("{}.", url.file_stem().unwrap().to_string_lossy());
|
|
||||||
}
|
|
||||||
"dot_ext" if ext.is_some() => {
|
|
||||||
return url.file_stem().unwrap().to_string_lossy().to_string();
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
url.file_name().map_or_else(String::new, |s| s.to_string_lossy().to_string())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn rename_and_hover(old: Url, new: Url) -> Result<()> {
|
async fn rename_and_hover(old: Url, new: Url) -> Result<()> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue