File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1515 clippy:: mod_module_files,
1616 clippy:: panic,
1717 clippy:: panic_in_result_fn,
18+ clippy:: ref_as_ptr,
19+ clippy:: return_self_not_must_use,
20+ clippy:: semicolon_if_nothing_returned,
1821 clippy:: std_instead_of_alloc,
1922 clippy:: std_instead_of_core,
2023 clippy:: unwrap_used,
@@ -50,7 +53,7 @@ pub trait Cmov {
5053 /// Moves `value` to `self` in constant-time if `condition` is equal to zero.
5154 fn cmovz ( & mut self , value : & Self , condition : Condition ) {
5255 let nz = masknz ! ( condition: Condition ) ;
53- self . cmovnz ( value, !nz)
56+ self . cmovnz ( value, !nz) ;
5457 }
5558}
5659
Original file line number Diff line number Diff line change 33use crate :: { Cmov , CmovEq , Condition } ;
44use core:: {
55 ops:: { BitOrAssign , Shl } ,
6- slice,
6+ ptr , slice,
77} ;
88
99// Uses 64-bit words on 64-bit targets, 32-bit everywhere else
@@ -267,9 +267,9 @@ unsafe fn cast_slice<T, U>(slice: &[T]) -> &[U] {
267267 // SAFETY:
268268 // - Slices are of same-sized/aligned types as asserted above.
269269 // - It's up to the caller to ensure the pointer cast from `T` to `U` itself is valid.
270- #[ allow( trivial_casts , unsafe_code) ]
270+ #[ allow( unsafe_code) ]
271271 unsafe {
272- & * ( ( slice as * const [ T ] ) as * const [ U ] )
272+ & * ( ptr :: from_ref :: < [ T ] > ( slice ) as * const [ U ] )
273273 }
274274}
275275
@@ -287,9 +287,9 @@ unsafe fn cast_slice_mut<T, U>(slice: &mut [T]) -> &mut [U] {
287287 // SAFETY:
288288 // - Slices are of same-sized/aligned types as asserted above.
289289 // - It's up to the caller to ensure the pointer cast from `T` to `U` itself is valid.
290- #[ allow( trivial_casts , unsafe_code) ]
290+ #[ allow( unsafe_code) ]
291291 unsafe {
292- & mut * ( ( slice as * mut [ T ] ) as * mut [ U ] )
292+ & mut * ( ptr :: from_mut :: < [ T ] > ( slice ) as * mut [ U ] )
293293 }
294294}
295295
You can’t perform that action at this time.
0 commit comments