Skip to content

Commit b7a1252

Browse files
committed
libazureinit: fix clippy warning for Rust 1.84
Starting from Rust 1.84, clippy gives warning like below: ``` warning: this `map_or` is redundant --> libazureinit/src/config.rs:345:21 | 345 | path.extension().map_or(false, |ext| ext == "toml") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `path.extension().is_some_and(|ext| ext == "toml")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `#[warn(clippy::unnecessary_map_or)]` on by default ``` Fix that by using `is_some_and`. See also https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-184, rust-lang/rust-clippy#11796.
1 parent 388c312 commit b7a1252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libazureinit/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl Config {
342342
.filter_map(Result::ok)
343343
.map(|entry| entry.path())
344344
.filter(|path| {
345-
path.extension().map_or(false, |ext| ext == "toml")
345+
path.extension().is_some_and(|ext| ext == "toml")
346346
})
347347
.collect();
348348

0 commit comments

Comments
 (0)