38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
error: stripping a prefix manually
|
|
--> $DIR/min_rust_version_attr.rs:142:24
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::manual-strip` implied by `-D warnings`
|
|
note: the prefix was tested here
|
|
--> $DIR/min_rust_version_attr.rs:141:9
|
|
|
|
|
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
|
|
--> $DIR/min_rust_version_attr.rs:154:24
|
|
|
|
|
LL | assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: the prefix was tested here
|
|
--> $DIR/min_rust_version_attr.rs:153:9
|
|
|
|
|
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
|
|
|