fix: new clippy warnings from rust 1.85.0 (#15203)

# Description
Mainly some cleanup of `map_or`.
This commit is contained in:
zc he
2025-02-27 21:11:47 +08:00
committed by GitHub
parent 12b8b4580c
commit 96af27fb4c
8 changed files with 21 additions and 26 deletions

View File

@ -159,14 +159,11 @@ impl DirInfo {
fn add_file(mut self, f: impl Into<PathBuf>, params: &DirBuilder) -> Self {
let f = f.into();
let include = params
.exclude
.as_ref()
.map_or(true, |x| !x.matches_path(&f));
let include = params.exclude.as_ref().is_none_or(|x| !x.matches_path(&f));
if include {
match FileInfo::new(f, params.deref, self.tag, self.long) {
Ok(file) => {
let inc = params.min.map_or(true, |s| file.size >= s);
let inc = params.min.is_none_or(|s| file.size >= s);
if inc {
self.size += file.size;
self.blocks += file.blocks.unwrap_or(0);