Auto merge of #9229 - FoseFx:case_sensitive_file_extension_comparisons_doc, r=dswij
Update case_sensitive_file_extension_comparisons example Closing #9220 changelog: [`case_sensitive_file_extension_comparisons`]: update example
This commit is contained in:
commit
75dcbd5b92
@ -24,7 +24,10 @@ declare_clippy_lint! {
|
||||
/// Use instead:
|
||||
/// ```rust
|
||||
/// fn is_rust_file(filename: &str) -> bool {
|
||||
/// filename.rsplit('.').next().map(|ext| ext.eq_ignore_ascii_case("rs")) == Some(true)
|
||||
/// let filename = std::path::Path::new(filename);
|
||||
/// filename.extension()
|
||||
/// .map(|ext| ext.eq_ignore_ascii_case("rs"))
|
||||
/// .unwrap_or(false)
|
||||
/// }
|
||||
/// ```
|
||||
#[clippy::version = "1.51.0"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user