diff --git a/src/highlight/file_tester.rs b/src/highlight/file_tester.rs index c3c166e4b..8149f0fe5 100644 --- a/src/highlight/file_tester.rs +++ b/src/highlight/file_tester.rs @@ -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) { diff --git a/src/highlight/highlight.rs b/src/highlight/highlight.rs index f6ef4fac5..037f50349 100644 --- a/src/highlight/highlight.rs +++ b/src/highlight/highlight.rs @@ -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)