rust-clippy/tests/ui/case_sensitive_file_extension_comparisons.stderr

88 lines
2.8 KiB
Text
Raw Normal View History

error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:14:5
|
LL | filename.ends_with(".rs")
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
2022-09-22 16:04:22 +00:00
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
help: use std::path::Path
|
LL ~ std::path::Path::new(filename)
LL + .extension()
LL + .map_or(false, |ext| ext.eq_ignore_ascii_case("rs"))
|
error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:19:13
|
LL | let _ = String::new().ends_with(".ext12");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
help: use std::path::Path
|
LL ~ let _ = std::path::Path::new(&String::new())
LL + .extension()
LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("ext12"));
|
error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:20:13
|
LL | let _ = "str".ends_with(".ext12");
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
help: use std::path::Path
|
LL ~ let _ = std::path::Path::new("str")
LL + .extension()
LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("ext12"));
|
error: case-sensitive file extension comparison
2023-01-04 14:06:07 +00:00
--> $DIR/case_sensitive_file_extension_comparisons.rs:24:17
|
LL | let _ = "str".ends_with(".ext12");
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
help: use std::path::Path
|
LL ~ let _ = std::path::Path::new("str")
LL + .extension()
LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("ext12"));
|
error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:31:13
|
LL | let _ = String::new().ends_with(".EXT12");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
help: use std::path::Path
|
LL ~ let _ = std::path::Path::new(&String::new())
LL + .extension()
LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12"));
|
error: case-sensitive file extension comparison
2023-01-04 14:06:07 +00:00
--> $DIR/case_sensitive_file_extension_comparisons.rs:32:13
|
LL | let _ = "str".ends_with(".EXT12");
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a case-insensitive comparison instead
help: use std::path::Path
|
LL ~ let _ = std::path::Path::new("str")
LL + .extension()
LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12"));
|
2023-01-04 14:06:07 +00:00
error: aborting due to 6 previous errors