@@ -102,7 +102,7 @@ mod single_char_add_str;
102
102
mod single_char_insert_string;
103
103
mod single_char_push_string;
104
104
mod skip_while_next;
105
- mod slice_as_bytes ;
105
+ mod sliced_string_as_bytes ;
106
106
mod stable_sort_primitive;
107
107
mod str_split;
108
108
mod str_splitn;
@@ -4386,8 +4386,8 @@ declare_clippy_lint! {
4386
4386
/// let s = "Lorem ipsum";
4387
4387
/// &s.as_bytes()[1..5];
4388
4388
/// ```
4389
- #[ clippy:: version = "1.72 .0" ]
4390
- pub SLICE_AS_BYTES ,
4389
+ #[ clippy:: version = "1.86 .0" ]
4390
+ pub SLICED_STRING_AS_BYTES ,
4391
4391
pedantic,
4392
4392
"slicing a string and immediately calling as_bytes is less efficient and can lead to panics"
4393
4393
}
@@ -4560,7 +4560,7 @@ impl_lint_pass!(Methods => [
4560
4560
DOUBLE_ENDED_ITERATOR_LAST ,
4561
4561
USELESS_NONZERO_NEW_UNCHECKED ,
4562
4562
MANUAL_REPEAT_N ,
4563
- SLICE_AS_BYTES ,
4563
+ SLICED_STRING_AS_BYTES ,
4564
4564
] ) ;
4565
4565
4566
4566
/// Extracts a method call name, args, and `Span` of the method name.
@@ -4828,7 +4828,7 @@ impl Methods {
4828
4828
if let Some ( ( "as_str" , recv, [ ] , as_str_span, _) ) = method_call ( recv) {
4829
4829
redundant_as_str:: check ( cx, expr, recv, as_str_span, span) ;
4830
4830
}
4831
- slice_as_bytes :: check ( cx, expr, recv) ;
4831
+ sliced_string_as_bytes :: check ( cx, expr, recv) ;
4832
4832
} ,
4833
4833
( "as_mut" , [ ] ) => useless_asref:: check ( cx, expr, "as_mut" , recv) ,
4834
4834
( "as_ptr" , [ ] ) => manual_c_str_literals:: check_as_ptr ( cx, expr, recv, & self . msrv ) ,
0 commit comments