Skip to content

Commit

Permalink
Improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Oct 17, 2023
1 parent b2b8068 commit 7151f40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Checker for ExistedChecker {
file_type.is_file() || file_type.is_symlink()
})
.unwrap_or(false)
&& (path.extension().is_some() || matches_arch(&path))
&& (path.extension().is_some() || matches_arch(path))
}

#[cfg(not(target_os = "windows"))]
Expand Down
4 changes: 2 additions & 2 deletions src/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl Finder {
}
_ => {
// Search binary in PATHs(defined in environment variable).
let p = paths.ok_or(Error::CannotFindBinaryPath)?;
let p = paths.ok_or(Error::CannotGetCurrentDirAndPathListEmpty)?;
let paths: Vec<_> = env::split_paths(&p).collect();

Either::Right(Self::path_search_candidates(path, paths).into_iter())
Expand All @@ -105,7 +105,7 @@ impl Finder {
where
T: AsRef<OsStr>,
{
let p = paths.ok_or(Error::CannotFindBinaryPath)?;
let p = paths.ok_or(Error::CannotGetCurrentDirAndPathListEmpty)?;
// Collect needs to happen in order to not have to
// change the API to borrow on `paths`.
#[allow(clippy::needless_collect)]
Expand Down

0 comments on commit 7151f40

Please sign in to comment.