Skip to content

Commit bfeaae8

Browse files
committed
suggest map_or in case_sensitive_file_extension_comparisons
Currently, case_sensitive_file_extension_comparisons suggests using `map(..).unwrap_or(..)` which trips up `map_unwrap_or`. This updates the suggestion to use map_or.
1 parent 048e4d0 commit bfeaae8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/case_sensitive_file_extension_comparisons.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ declare_clippy_lint! {
2626
/// fn is_rust_file(filename: &str) -> bool {
2727
/// let filename = std::path::Path::new(filename);
2828
/// filename.extension()
29-
/// .map(|ext| ext.eq_ignore_ascii_case("rs"))
30-
/// .unwrap_or(false)
29+
/// .map_or(false, |ext| ext.eq_ignore_ascii_case("rs"))
3130
/// }
3231
/// ```
3332
#[clippy::version = "1.51.0"]

0 commit comments

Comments
 (0)