Skip to content

Commit

Permalink
tests/bench: fix redundant map_or lints
Browse files Browse the repository at this point in the history
  • Loading branch information
hellux committed Jan 9, 2025
1 parent 7e008d5 commit 77488ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bench/input/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() -> std::io::Result<()> {
let entry = entry.ok()?;
if let Some(name) = entry.file_name().to_str() {
if let Some(name) = name.strip_suffix(".dj") {
if entry.file_type().map_or(false, |ty| !ty.is_dir()) {
if entry.file_type().is_ok_and(|ty| !ty.is_dir()) {
let input = std::fs::read_to_string(
std::path::Path::new(".").join(entry.file_name()),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/html-ref/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
fn main() {
let has_dj = std::fs::read_dir(".").unwrap().any(|e| {
e.map_or(false, |e| {
e.is_ok_and(|e| {
e.path()
.extension()
.map_or(false, |ext| ext.to_str() == Some("dj"))
.is_some_and(|ext| ext.to_str() == Some("dj"))
})
});
if has_dj {
Expand Down

0 comments on commit 77488ed

Please sign in to comment.