2020-12-06 14:01:03 +00:00
|
|
|
error: stripping a prefix manually
|
2021-01-02 15:29:43 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:150:24
|
2020-12-06 14:01:03 +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-01-02 15:29:43 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:149:9
|
2020-12-06 14:01:03 +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!");
|
|
|
|
|
|
|
|
|
|
|
|
|
error: stripping a prefix manually
|
2021-01-02 15:29:43 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:162:24
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the prefix was tested here
|
2021-01-02 15:29:43 +00:00
|
|
|
--> $DIR/min_rust_version_attr.rs:161:9
|
2020-12-06 14:01:03 +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!");
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|