mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
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:
parent
048e4d004a
commit
bfeaae8930
1 changed files with 1 additions and 2 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Reference in a new issue