]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: stripping a prefix manually |
2 | --> $DIR/manual_strip.rs:7:24 | |
3 | | | |
4 | LL | str::to_string(&s["ab".len()..]); | |
5 | | ^^^^^^^^^^^^^^^^ | |
6 | | | |
7 | = note: `-D clippy::manual-strip` implied by `-D warnings` | |
8 | note: the prefix was tested here | |
9 | --> $DIR/manual_strip.rs:6:5 | |
10 | | | |
11 | LL | if s.starts_with("ab") { | |
12 | | ^^^^^^^^^^^^^^^^^^^^^^^ | |
13 | help: try using the `strip_prefix` method | |
14 | | | |
15 | LL | if let Some(<stripped>) = s.strip_prefix("ab") { | |
16 | LL | str::to_string(<stripped>); | |
17 | LL | <stripped>.to_string(); | |
18 | LL | | |
19 | LL | str::to_string(<stripped>); | |
20 | LL | <stripped>.to_string(); | |
21 | | | |
22 | ||
23 | error: stripping a suffix manually | |
24 | --> $DIR/manual_strip.rs:15:24 | |
25 | | | |
26 | LL | str::to_string(&s[..s.len() - "bc".len()]); | |
27 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
28 | | | |
29 | note: the suffix was tested here | |
30 | --> $DIR/manual_strip.rs:14:5 | |
31 | | | |
32 | LL | if s.ends_with("bc") { | |
33 | | ^^^^^^^^^^^^^^^^^^^^^ | |
34 | help: try using the `strip_suffix` method | |
35 | | | |
36 | LL | if let Some(<stripped>) = s.strip_suffix("bc") { | |
37 | LL | str::to_string(<stripped>); | |
38 | LL | <stripped>.to_string(); | |
39 | LL | | |
40 | LL | str::to_string(<stripped>); | |
41 | LL | <stripped>.to_string(); | |
42 | | | |
43 | ||
44 | error: stripping a prefix manually | |
45 | --> $DIR/manual_strip.rs:24:24 | |
46 | | | |
47 | LL | str::to_string(&s[1..]); | |
48 | | ^^^^^^^ | |
49 | | | |
50 | note: the prefix was tested here | |
51 | --> $DIR/manual_strip.rs:23:5 | |
52 | | | |
53 | LL | if s.starts_with('a') { | |
54 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
55 | help: try using the `strip_prefix` method | |
56 | | | |
57 | LL | if let Some(<stripped>) = s.strip_prefix('a') { | |
58 | LL | str::to_string(<stripped>); | |
59 | LL | <stripped>.to_string(); | |
60 | | | |
61 | ||
62 | error: stripping a prefix manually | |
63 | --> $DIR/manual_strip.rs:31:24 | |
64 | | | |
65 | LL | str::to_string(&s[prefix.len()..]); | |
66 | | ^^^^^^^^^^^^^^^^^^ | |
67 | | | |
68 | note: the prefix was tested here | |
69 | --> $DIR/manual_strip.rs:30:5 | |
70 | | | |
71 | LL | if s.starts_with(prefix) { | |
72 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
73 | help: try using the `strip_prefix` method | |
74 | | | |
75 | LL | if let Some(<stripped>) = s.strip_prefix(prefix) { | |
76 | LL | str::to_string(<stripped>); | |
77 | | | |
78 | ||
79 | error: stripping a prefix manually | |
80 | --> $DIR/manual_strip.rs:37:24 | |
81 | | | |
82 | LL | str::to_string(&s[PREFIX.len()..]); | |
83 | | ^^^^^^^^^^^^^^^^^^ | |
84 | | | |
85 | note: the prefix was tested here | |
86 | --> $DIR/manual_strip.rs:36:5 | |
87 | | | |
88 | LL | if s.starts_with(PREFIX) { | |
89 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
90 | help: try using the `strip_prefix` method | |
91 | | | |
92 | LL | if let Some(<stripped>) = s.strip_prefix(PREFIX) { | |
93 | LL | str::to_string(<stripped>); | |
94 | LL | str::to_string(<stripped>); | |
95 | | | |
96 | ||
97 | error: stripping a prefix manually | |
98 | --> $DIR/manual_strip.rs:44:24 | |
99 | | | |
100 | LL | str::to_string(&TARGET[prefix.len()..]); | |
101 | | ^^^^^^^^^^^^^^^^^^^^^^^ | |
102 | | | |
103 | note: the prefix was tested here | |
104 | --> $DIR/manual_strip.rs:43:5 | |
105 | | | |
106 | LL | if TARGET.starts_with(prefix) { | |
107 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
108 | help: try using the `strip_prefix` method | |
109 | | | |
110 | LL | if let Some(<stripped>) = TARGET.strip_prefix(prefix) { | |
111 | LL | str::to_string(<stripped>); | |
112 | | | |
113 | ||
114 | error: stripping a prefix manually | |
115 | --> $DIR/manual_strip.rs:50:9 | |
116 | | | |
117 | LL | s1[2..].to_uppercase(); | |
118 | | ^^^^^^^ | |
119 | | | |
120 | note: the prefix was tested here | |
121 | --> $DIR/manual_strip.rs:49:5 | |
122 | | | |
123 | LL | if s1.starts_with("ab") { | |
124 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
125 | help: try using the `strip_prefix` method | |
126 | | | |
127 | LL | if let Some(<stripped>) = s1.strip_prefix("ab") { | |
128 | LL | <stripped>.to_uppercase(); | |
129 | | | |
130 | ||
131 | error: aborting due to 7 previous errors | |
132 |