1 error: stripping a prefix manually
2 --> $DIR/manual_strip.rs:7:24
4 LL | str::to_string(&s["ab".len()..]);
7 = note: `-D clippy::manual-strip` implied by `-D warnings`
8 note: the prefix was tested here
9 --> $DIR/manual_strip.rs:6:5
11 LL | if s.starts_with("ab") {
12 | ^^^^^^^^^^^^^^^^^^^^^^^
13 help: try using the `strip_prefix` method
15 LL | if let Some(<stripped>) = s.strip_prefix("ab") {
16 LL | str::to_string(<stripped>);
17 LL | <stripped>.to_string();
19 LL | str::to_string(<stripped>);
20 LL | <stripped>.to_string();
23 error: stripping a suffix manually
24 --> $DIR/manual_strip.rs:15:24
26 LL | str::to_string(&s[..s.len() - "bc".len()]);
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
29 note: the suffix was tested here
30 --> $DIR/manual_strip.rs:14:5
32 LL | if s.ends_with("bc") {
33 | ^^^^^^^^^^^^^^^^^^^^^
34 help: try using the `strip_suffix` method
36 LL | if let Some(<stripped>) = s.strip_suffix("bc") {
37 LL | str::to_string(<stripped>);
38 LL | <stripped>.to_string();
40 LL | str::to_string(<stripped>);
41 LL | <stripped>.to_string();
44 error: stripping a prefix manually
45 --> $DIR/manual_strip.rs:24:24
47 LL | str::to_string(&s[1..]);
50 note: the prefix was tested here
51 --> $DIR/manual_strip.rs:23:5
53 LL | if s.starts_with('a') {
54 | ^^^^^^^^^^^^^^^^^^^^^^
55 help: try using the `strip_prefix` method
57 LL | if let Some(<stripped>) = s.strip_prefix('a') {
58 LL | str::to_string(<stripped>);
59 LL | <stripped>.to_string();
62 error: stripping a prefix manually
63 --> $DIR/manual_strip.rs:31:24
65 LL | str::to_string(&s[prefix.len()..]);
68 note: the prefix was tested here
69 --> $DIR/manual_strip.rs:30:5
71 LL | if s.starts_with(prefix) {
72 | ^^^^^^^^^^^^^^^^^^^^^^^^^
73 help: try using the `strip_prefix` method
75 LL | if let Some(<stripped>) = s.strip_prefix(prefix) {
76 LL | str::to_string(<stripped>);
79 error: stripping a prefix manually
80 --> $DIR/manual_strip.rs:37:24
82 LL | str::to_string(&s[PREFIX.len()..]);
85 note: the prefix was tested here
86 --> $DIR/manual_strip.rs:36:5
88 LL | if s.starts_with(PREFIX) {
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^
90 help: try using the `strip_prefix` method
92 LL | if let Some(<stripped>) = s.strip_prefix(PREFIX) {
93 LL | str::to_string(<stripped>);
94 LL | str::to_string(<stripped>);
97 error: stripping a prefix manually
98 --> $DIR/manual_strip.rs:44:24
100 LL | str::to_string(&TARGET[prefix.len()..]);
101 | ^^^^^^^^^^^^^^^^^^^^^^^
103 note: the prefix was tested here
104 --> $DIR/manual_strip.rs:43:5
106 LL | if TARGET.starts_with(prefix) {
107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108 help: try using the `strip_prefix` method
110 LL | if let Some(<stripped>) = TARGET.strip_prefix(prefix) {
111 LL | str::to_string(<stripped>);
114 error: stripping a prefix manually
115 --> $DIR/manual_strip.rs:50:9
117 LL | s1[2..].to_uppercase();
120 note: the prefix was tested here
121 --> $DIR/manual_strip.rs:49:5
123 LL | if s1.starts_with("ab") {
124 | ^^^^^^^^^^^^^^^^^^^^^^^^
125 help: try using the `strip_prefix` method
127 LL | if let Some(<stripped>) = s1.strip_prefix("ab") {
128 LL | <stripped>.to_uppercase();
131 error: aborting due to 7 previous errors