|
1 | 1 | error: case-sensitive file extension comparison
|
2 |
| - --> $DIR/case_sensitive_file_extension_comparisons.rs:12:14 |
| 2 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:14:5 |
3 | 3 | |
|
4 | 4 | LL | filename.ends_with(".rs")
|
5 |
| - | ^^^^^^^^^^^^^^^^ |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 6 | |
|
7 | 7 | = help: consider using a case-insensitive comparison instead
|
8 | 8 | = note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
|
| 9 | +help: use std::path::Path |
| 10 | + | |
| 11 | +LL ~ std::path::Path::new(filename) |
| 12 | +LL + .extension() |
| 13 | +LL + .map_or(false, |ext| ext.eq_ignore_ascii_case("rs")) |
| 14 | + | |
9 | 15 |
|
10 | 16 | error: case-sensitive file extension comparison
|
11 |
| - --> $DIR/case_sensitive_file_extension_comparisons.rs:17:27 |
| 17 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:19:13 |
12 | 18 | |
|
13 | 19 | LL | let _ = String::new().ends_with(".ext12");
|
14 |
| - | ^^^^^^^^^^^^^^^^^^^ |
| 20 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
15 | 21 | |
|
16 | 22 | = help: consider using a case-insensitive comparison instead
|
| 23 | +help: use std::path::Path |
| 24 | + | |
| 25 | +LL ~ let _ = std::path::Path::new(&String::new()) |
| 26 | +LL + .extension() |
| 27 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("ext12")); |
| 28 | + | |
17 | 29 |
|
18 | 30 | error: case-sensitive file extension comparison
|
19 |
| - --> $DIR/case_sensitive_file_extension_comparisons.rs:18:19 |
| 31 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:20:13 |
20 | 32 | |
|
21 | 33 | LL | let _ = "str".ends_with(".ext12");
|
22 |
| - | ^^^^^^^^^^^^^^^^^^^ |
| 34 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
23 | 35 | |
|
24 | 36 | = help: consider using a case-insensitive comparison instead
|
| 37 | +help: use std::path::Path |
| 38 | + | |
| 39 | +LL ~ let _ = std::path::Path::new("str") |
| 40 | +LL + .extension() |
| 41 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("ext12")); |
| 42 | + | |
25 | 43 |
|
26 | 44 | error: case-sensitive file extension comparison
|
27 |
| - --> $DIR/case_sensitive_file_extension_comparisons.rs:24:27 |
| 45 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:26:13 |
28 | 46 | |
|
29 | 47 | LL | let _ = String::new().ends_with(".EXT12");
|
30 |
| - | ^^^^^^^^^^^^^^^^^^^ |
| 48 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
31 | 49 | |
|
32 | 50 | = help: consider using a case-insensitive comparison instead
|
| 51 | +help: use std::path::Path |
| 52 | + | |
| 53 | +LL ~ let _ = std::path::Path::new(&String::new()) |
| 54 | +LL + .extension() |
| 55 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12")); |
| 56 | + | |
33 | 57 |
|
34 | 58 | error: case-sensitive file extension comparison
|
35 |
| - --> $DIR/case_sensitive_file_extension_comparisons.rs:25:19 |
| 59 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:27:13 |
36 | 60 | |
|
37 | 61 | LL | let _ = "str".ends_with(".EXT12");
|
38 |
| - | ^^^^^^^^^^^^^^^^^^^ |
| 62 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 63 | + | |
| 64 | + = help: consider using a case-insensitive comparison instead |
| 65 | +help: use std::path::Path |
| 66 | + | |
| 67 | +LL ~ let _ = std::path::Path::new("str") |
| 68 | +LL + .extension() |
| 69 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12")); |
| 70 | + | |
| 71 | + |
| 72 | +error: case-sensitive file extension comparison |
| 73 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:30:13 |
| 74 | + | |
| 75 | +LL | let _ = String::new().to_lowercase().ends_with(".EXT12"); |
| 76 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 77 | + | |
| 78 | + = help: consider using a case-insensitive comparison instead |
| 79 | + = note: to_lowercase allocates memory, this can be avoided by using Path |
| 80 | +help: use std::path::Path |
| 81 | + | |
| 82 | +LL ~ let _ = std::path::Path::new(&String::new()) |
| 83 | +LL + .extension() |
| 84 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12")); |
| 85 | + | |
| 86 | + |
| 87 | +error: case-sensitive file extension comparison |
| 88 | + --> $DIR/case_sensitive_file_extension_comparisons.rs:31:13 |
| 89 | + | |
| 90 | +LL | let _ = String::new().to_uppercase().ends_with(".EXT12"); |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
39 | 92 | |
|
40 | 93 | = help: consider using a case-insensitive comparison instead
|
| 94 | + = note: to_uppercase allocates memory, this can be avoided by using Path |
| 95 | +help: use std::path::Path |
| 96 | + | |
| 97 | +LL ~ let _ = std::path::Path::new(&String::new()) |
| 98 | +LL + .extension() |
| 99 | +LL ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("EXT12")); |
| 100 | + | |
41 | 101 |
|
42 |
| -error: aborting due to 5 previous errors |
| 102 | +error: aborting due to 7 previous errors |
43 | 103 |
|
0 commit comments