File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 172
172
clippy:: correctness,
173
173
clippy:: dbg_macro,
174
174
clippy:: decimal_literal_representation,
175
+ clippy:: expect_used,
175
176
clippy:: get_unwrap,
176
177
clippy:: indexing_slicing,
177
178
clippy:: missing_inline_in_public_items,
@@ -1026,6 +1027,7 @@ pub unsafe trait FromZeroes {
1026
1027
/// * Panics if `size_of::<Self>() * len` overflows.
1027
1028
/// * Panics if allocation of `size_of::<Self>() * len` bytes fails.
1028
1029
#[ cfg( feature = "alloc" ) ]
1030
+ #[ allow( clippy:: expect_used) ]
1029
1031
#[ inline]
1030
1032
fn new_box_slice_zeroed ( len : usize ) -> Box < [ Self ] >
1031
1033
where
@@ -1415,10 +1417,7 @@ pub unsafe trait AsBytes {
1415
1417
#[ inline]
1416
1418
fn write_to_suffix ( & self , bytes : & mut [ u8 ] ) -> Option < ( ) > {
1417
1419
let start = bytes. len ( ) . checked_sub ( mem:: size_of_val ( self ) ) ?;
1418
- bytes
1419
- . get_mut ( start..)
1420
- . expect ( "`start` should be in-bounds of `bytes`" )
1421
- . copy_from_slice ( self . as_bytes ( ) ) ;
1420
+ bytes. get_mut ( start..) ?. copy_from_slice ( self . as_bytes ( ) ) ;
1422
1421
Some ( ( ) )
1423
1422
}
1424
1423
}
@@ -2241,6 +2240,7 @@ where
2241
2240
/// `new_slice` panics if `T` is a zero-sized type.
2242
2241
#[ inline]
2243
2242
pub fn new_slice ( bytes : B ) -> Option < Ref < B , [ T ] > > {
2243
+ #[ allow( clippy:: expect_used) ]
2244
2244
let remainder = bytes
2245
2245
. len ( )
2246
2246
. checked_rem ( mem:: size_of :: < T > ( ) )
You can’t perform that action at this time.
0 commit comments