refactor(clippy): apply new rust lint fixes

This commit is contained in:
LGUG2Z
2025-04-03 08:41:55 -07:00
parent f4bbee0a2e
commit 7d821cd3db
2 changed files with 2 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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())
}