2020-12-09 11:09:33 +00:00
|
|
|
error: stripping a prefix manually
|
2021-03-26 09:56:05 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:156:24
|
2020-11-29 11:38:56 +00:00
|
|
|
|
|
2020-12-09 11:09:33 +00: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-03-26 09:56:05 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:155:9
|
2020-12-09 11:09:33 +00:00
|
|
|
|
|
|
|
|
LL | if s.starts_with("hello, ") {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try using the `strip_prefix` method
|
|
|
|
|
|
|
|
|
LL | if let Some(<stripped>) = s.strip_prefix("hello, ") {
|
|
|
|
LL | assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
2020-11-29 11:38:56 +00:00
|
|
|
|
|
2020-12-05 12:59:22 +00:00
|
|
|
|
2020-12-09 11:09:33 +00:00
|
|
|
error: stripping a prefix manually
|
2021-03-26 09:56:05 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:168:24
|
2020-12-09 11:09:33 +00:00
|
|
|
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the prefix was tested here
|
2021-03-26 09:56:05 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:167:9
|
2020-12-09 11:09:33 +00:00
|
|
|
|
|
|
|
|
LL | if s.starts_with("hello, ") {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try using the `strip_prefix` method
|
2020-11-29 11:38:56 +00:00
|
|
|
|
|
2020-12-09 11:09:33 +00:00
|
|
|
LL | if let Some(<stripped>) = s.strip_prefix("hello, ") {
|
|
|
|
LL | assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
2020-11-29 11:38:56 +00:00
|
|
|
|
|
|
|
|
|
2020-12-09 11:09:33 +00:00
|
|
|
error: aborting due to 2 previous errors
|
2020-11-29 11:38:56 +00:00
|
|
|
|