We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_none_or
stdlib-module-shadowing
1 parent c892fee commit 8c0eac2Copy full SHA for 8c0eac2
1 file changed
crates/ruff_linter/src/rules/flake8_builtins/rules/stdlib_module_shadowing.rs
@@ -120,10 +120,7 @@ pub(crate) fn stdlib_module_shadowing(
120
fn get_prefix<'a>(settings: &'a LinterSettings, path: &Path) -> Option<&'a PathBuf> {
121
let mut prefix = None;
122
for dir in settings.src.iter().chain([&settings.project_root]) {
123
- if path.starts_with(dir)
124
- // TODO `is_none_or` when MSRV >= 1.82
125
- && (prefix.is_none() || prefix.is_some_and(|existing| existing < dir))
126
- {
+ if path.starts_with(dir) && prefix.is_none_or(|existing| existing < dir) {
127
prefix = Some(dir);
128
}
129
0 commit comments