@@ -102,7 +102,7 @@ mod single_char_add_str;
102102mod single_char_insert_string;
103103mod single_char_push_string;
104104mod skip_while_next;
105- mod slice_as_bytes ;
105+ mod sliced_string_as_bytes ;
106106mod stable_sort_primitive;
107107mod str_split;
108108mod str_splitn;
@@ -4386,8 +4386,8 @@ declare_clippy_lint! {
43864386 /// let s = "Lorem ipsum";
43874387 /// &s.as_bytes()[1..5];
43884388 /// ```
4389- #[ clippy:: version = "1.72 .0" ]
4390- pub SLICE_AS_BYTES ,
4389+ #[ clippy:: version = "1.86 .0" ]
4390+ pub SLICED_STRING_AS_BYTES ,
43914391 pedantic,
43924392 "slicing a string and immediately calling as_bytes is less efficient and can lead to panics"
43934393}
@@ -4560,7 +4560,7 @@ impl_lint_pass!(Methods => [
45604560 DOUBLE_ENDED_ITERATOR_LAST ,
45614561 USELESS_NONZERO_NEW_UNCHECKED ,
45624562 MANUAL_REPEAT_N ,
4563- SLICE_AS_BYTES ,
4563+ SLICED_STRING_AS_BYTES ,
45644564] ) ;
45654565
45664566/// Extracts a method call name, args, and `Span` of the method name.
@@ -4828,7 +4828,7 @@ impl Methods {
48284828 if let Some ( ( "as_str" , recv, [ ] , as_str_span, _) ) = method_call ( recv) {
48294829 redundant_as_str:: check ( cx, expr, recv, as_str_span, span) ;
48304830 }
4831- slice_as_bytes :: check ( cx, expr, recv) ;
4831+ sliced_string_as_bytes :: check ( cx, expr, recv) ;
48324832 } ,
48334833 ( "as_mut" , [ ] ) => useless_asref:: check ( cx, expr, "as_mut" , recv) ,
48344834 ( "as_ptr" , [ ] ) => manual_c_str_literals:: check_as_ptr ( cx, expr, recv, & self . msrv ) ,
0 commit comments