Skip to content

Commit 2de9ea7

Browse files
committed
Resolve map_unwrap_or pedantic clippy lint
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead --> tests/repo/mod.rs:73:8 | 73 | if path.extension().map(|e| e != "rs").unwrap_or(true) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::map-unwrap-or` implied by `-D clippy::pedantic` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or help: use `map_or(<a>, <f>)` instead | 73 - if path.extension().map(|e| e != "rs").unwrap_or(true) { 73 + if path.extension().map_or(true, |e| e != "rs") { |
1 parent d9a6d8f commit 2de9ea7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/repo/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::if_then_panic, clippy::map_unwrap_or)]
1+
#![allow(clippy::if_then_panic)]
22

33
mod progress;
44

@@ -70,7 +70,7 @@ pub fn base_dir_filter(entry: &DirEntry) -> bool {
7070
if path.is_dir() {
7171
return true; // otherwise walkdir does not visit the files
7272
}
73-
if path.extension().map(|e| e != "rs").unwrap_or(true) {
73+
if path.extension().map_or(true, |e| e != "rs") {
7474
return false;
7575
}
7676

0 commit comments

Comments
 (0)