Address clippy lints

This commit is contained in:
Johannes Altmanninger 2025-01-14 00:52:44 +01:00
parent de6c4f85bc
commit c7adb572d0
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ impl<'s> FileTester<'s> {
// Note we color "try_input" files as errors if they are invalid,
// even though it's possible to execute these (replaced via /dev/null).
waccess(&target_path, libc::R_OK) == 0
&& wstat(&target_path).map_or(false, |md| !md.file_type().is_dir())
&& wstat(&target_path).is_ok_and(|md| !md.file_type().is_dir())
}
RedirectionMode::overwrite | RedirectionMode::append | RedirectionMode::noclob => {
if string_suffixes_string(L!("/"), &target) {

View File

@ -891,7 +891,7 @@ impl<'s> Highlighter<'s> {
let source_range = arg.source_range();
let is_prefix = self
.cursor
.map_or(false, |c| source_range.contains_inclusive(c));
.is_some_and(|c| source_range.contains_inclusive(c));
let token = arg.source(self.buff).to_owned();
let test_result = if cmd_is_cd {
self.file_tester.test_cd_path(&token, is_prefix)