We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05a51e5 commit 6620aa0Copy full SHA for 6620aa0
clippy_lints/src/case_sensitive_file_extension_comparisons.rs
@@ -24,7 +24,10 @@ declare_clippy_lint! {
24
/// Use instead:
25
/// ```rust
26
/// fn is_rust_file(filename: &str) -> bool {
27
- /// filename.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rs")) == Some(true)
+ /// let filename = std::path::Path::new(filename);
28
+ /// filename.extension()
29
+ /// .map(|ext| ext.eq_ignore_ascii_case("rs"))
30
+ /// .unwrap_or(false)
31
/// }
32
/// ```
33
#[clippy::version = "1.51.0"]
0 commit comments