Files
rust/tests/ui/sliced_string_as_bytes.stderr

24 lines
932 B
Plaintext
Raw Normal View History

2025-01-15 17:19:21 +01:00
error: calling `as_bytes` after slicing a string
--> tests/ui/sliced_string_as_bytes.rs:28:17
2025-01-15 17:19:21 +01:00
|
2025-01-15 15:58:18 +01:00
LL | let bytes = s[1..5].as_bytes();
2025-01-15 17:19:21 +01:00
| ^^^^^^^^^^^^^^^^^^ help: try: `&s.as_bytes()[1..5]`
|
2025-01-15 22:46:18 +01:00
= note: `-D clippy::sliced-string-as-bytes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]`
2025-01-15 15:58:18 +01:00
2025-01-15 17:19:21 +01:00
error: calling `as_bytes` after slicing a string
2025-02-11 17:57:08 +01:00
--> tests/ui/sliced_string_as_bytes.rs:30:17
2025-01-15 17:19:21 +01:00
|
2025-01-15 15:58:18 +01:00
LL | let bytes = string[1..].as_bytes();
2025-01-15 17:19:21 +01:00
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&string.as_bytes()[1..]`
2025-01-15 15:58:18 +01:00
2025-01-15 17:19:21 +01:00
error: calling `as_bytes` after slicing a string
2025-02-11 17:57:08 +01:00
--> tests/ui/sliced_string_as_bytes.rs:32:17
2025-01-15 17:19:21 +01:00
|
2025-01-15 15:58:18 +01:00
LL | let bytes = "consectetur adipiscing"[..=5].as_bytes();
2025-01-15 17:19:21 +01:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&"consectetur adipiscing".as_bytes()[..=5]`
2025-01-15 15:58:18 +01:00
error: aborting due to 3 previous errors
2025-01-15 17:19:21 +01:00