mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-10 23:22:43 +02: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() {
|
Ok(if parent.is_dir() {
|
||||||
let file = resolved_path
|
let file = resolved_path
|
||||||
.components()
|
.components()
|
||||||
.last()
|
.next_back()
|
||||||
.ok_or_else(|| anyhow!("cannot parse filename"))?;
|
.ok_or_else(|| anyhow!("cannot parse filename"))?;
|
||||||
dunce::canonicalize(parent)?.join(file)
|
dunce::canonicalize(parent)?.join(file)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -939,7 +939,7 @@ impl WindowsApi {
|
|||||||
pub fn exe(handle: HANDLE) -> Result<String> {
|
pub fn exe(handle: HANDLE) -> Result<String> {
|
||||||
Ok(Self::exe_path(handle)?
|
Ok(Self::exe_path(handle)?
|
||||||
.split('\\')
|
.split('\\')
|
||||||
.last()
|
.next_back()
|
||||||
.ok_or_else(|| anyhow!("there is no last element"))?
|
.ok_or_else(|| anyhow!("there is no last element"))?
|
||||||
.to_string())
|
.to_string())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user