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.
This commit is contained in:
Brian Caswell 2022-08-16 16:03:23 -04:00
parent 048e4d004a
commit bfeaae8930

View file

@ -26,8 +26,7 @@ declare_clippy_lint! {
/// fn is_rust_file(filename: &str) -> bool {
/// let filename = std::path::Path::new(filename);
/// filename.extension()
/// .map(|ext| ext.eq_ignore_ascii_case("rs"))
/// .unwrap_or(false)
/// .map_or(false, |ext| ext.eq_ignore_ascii_case("rs"))
/// }
/// ```
#[clippy::version = "1.51.0"]