2020-12-06 08:01:03 -06:00
|
|
|
error: stripping a prefix manually
|
2021-04-27 09:55:11 -05:00
|
|
|
--> $DIR/min_rust_version_attr.rs:160:24
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-strip` implied by `-D warnings`
|
|
|
|
note: the prefix was tested here
|
2021-04-27 09:55:11 -05:00
|
|
|
--> $DIR/min_rust_version_attr.rs:159:9
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
LL | if s.starts_with("hello, ") {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try using the `strip_prefix` method
|
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if let Some(<stripped>) = s.strip_prefix("hello, ") {
|
|
|
|
LL ~ assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: stripping a prefix manually
|
2021-04-27 09:55:11 -05:00
|
|
|
--> $DIR/min_rust_version_attr.rs:172:24
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the prefix was tested here
|
2021-04-27 09:55:11 -05:00
|
|
|
--> $DIR/min_rust_version_attr.rs:171:9
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
LL | if s.starts_with("hello, ") {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try using the `strip_prefix` method
|
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ if let Some(<stripped>) = s.strip_prefix("hello, ") {
|
|
|
|
LL ~ assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
2020-12-06 08:01:03 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|