forked from extern/nushell
fix: new clippy warnings from rust 1.85.0 (#15203)
# Description Mainly some cleanup of `map_or`.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user