Skip to content

Commit

Permalink
Use is_none_or in stdlib-module-shadowing (#16402)
Browse files Browse the repository at this point in the history
Summary
--
This resolves a TODO I left behind in #16006 now that our MSRV is 1.83.

Test Plan
--
Existing tests
  • Loading branch information
ntBre authored Feb 26, 2025
1 parent c892fee commit 8c0eac2
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ pub(crate) fn stdlib_module_shadowing(
fn get_prefix<'a>(settings: &'a LinterSettings, path: &Path) -> Option<&'a PathBuf> {
let mut prefix = None;
for dir in settings.src.iter().chain([&settings.project_root]) {
if path.starts_with(dir)
// TODO `is_none_or` when MSRV >= 1.82
&& (prefix.is_none() || prefix.is_some_and(|existing| existing < dir))
{
if path.starts_with(dir) && prefix.is_none_or(|existing| existing < dir) {
prefix = Some(dir);
}
}
Expand Down

0 comments on commit 8c0eac2

Please sign in to comment.