about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/sliced_string_as_bytes.stderr
blob: ae7f02781f4bb1b6dff50975f0b5eb752e908553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error: calling `as_bytes` after slicing a string
  --> tests/ui/sliced_string_as_bytes.rs:28:17
   |
LL |     let bytes = s[1..5].as_bytes();
   |                 ^^^^^^^^^^^^^^^^^^ help: try: `&s.as_bytes()[1..5]`
   |
   = note: `-D clippy::sliced-string-as-bytes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]`

error: calling `as_bytes` after slicing a string
  --> tests/ui/sliced_string_as_bytes.rs:30:17
   |
LL |     let bytes = string[1..].as_bytes();
   |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&string.as_bytes()[1..]`

error: calling `as_bytes` after slicing a string
  --> tests/ui/sliced_string_as_bytes.rs:32:17
   |
LL |     let bytes = "consectetur adipiscing"[..=5].as_bytes();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&"consectetur adipiscing".as_bytes()[..=5]`

error: aborting due to 3 previous errors