Skip to content

Commit 6ebd966

Browse files
committed
Resolve sliced_string_as_bytes clippy lint
warning: calling `as_bytes` after slicing a string --> src/lit.rs:1540:21 | 1540 | let mut v = s[2..].as_bytes(); | ^^^^^^^^^^^^^^^^^ help: try: `&s.as_bytes()[2..]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes = note: `-W clippy::sliced-string-as-bytes` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::sliced_string_as_bytes)]`
1 parent a09b650 commit 6ebd966

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ mod value {
15371537
assert_eq!(byte(s, 1), b'\'');
15381538

15391539
// We're going to want to have slices which don't respect codepoint boundaries.
1540-
let mut v = s[2..].as_bytes();
1540+
let mut v = &s.as_bytes()[2..];
15411541

15421542
let b = match byte(v, 0) {
15431543
b'\\' => {

0 commit comments

Comments
 (0)