mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-21 17:09:20 +01:00
refactor(clippy): apply new rust lint fixes
This commit is contained in:
@@ -490,7 +490,7 @@ pub fn resolve_home_path<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
|
||||
Ok(if parent.is_dir() {
|
||||
let file = resolved_path
|
||||
.components()
|
||||
.last()
|
||||
.next_back()
|
||||
.ok_or_else(|| anyhow!("cannot parse filename"))?;
|
||||
dunce::canonicalize(parent)?.join(file)
|
||||
} else {
|
||||
|
||||
@@ -939,7 +939,7 @@ impl WindowsApi {
|
||||
pub fn exe(handle: HANDLE) -> Result<String> {
|
||||
Ok(Self::exe_path(handle)?
|
||||
.split('\\')
|
||||
.last()
|
||||
.next_back()
|
||||
.ok_or_else(|| anyhow!("there is no last element"))?
|
||||
.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user