File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ dbg_macro = "warn"
1919pedantic = {level = " warn" , priority = -1 }
2020inline_always = " allow" # TODO: benchmark inlines
2121missing_panics_doc = " allow" # TODO
22- ptr_as_ptr = " allow" # 3
2322similar_names = " allow" # 26
2423float_cmp = " allow" # 41
2524map_unwrap_or = " allow" # 56
Original file line number Diff line number Diff line change @@ -334,7 +334,12 @@ mod enabled {
334334 let mut out_values = out_values;
335335 out_values. pop ( ) . unwrap ( )
336336 } else {
337- [ ret] . into_iter ( ) . chain ( out_values) . map ( Boxed ) . collect :: < Array < _ > > ( ) . into ( )
337+ [ ret]
338+ . into_iter ( )
339+ . chain ( out_values)
340+ . map ( Boxed )
341+ . collect :: < Array < _ > > ( )
342+ . into ( )
338343 }
339344 } ;
340345
@@ -420,7 +425,7 @@ mod enabled {
420425 libffi:: raw:: ffi_call (
421426 cif. as_raw_ptr ( ) ,
422427 Some ( * fun. as_safe_fun ( ) ) ,
423- result. as_mut_ptr ( ) as * mut c_void ,
428+ result. as_mut_ptr ( ) . cast ( ) ,
424429 args. as_ptr ( ) as * mut * mut c_void ,
425430 ) ;
426431 result
@@ -467,10 +472,11 @@ mod enabled {
467472 FfiType :: ULongLong => arr ! ( c_ulonglong) ,
468473 _ => Ok ( if ptr. ty . is_string ( ) {
469474 ( 0 ..len)
470- . map ( |index| ptr. ty . unrepr ( & repr[ index * size..( index + 1 ) * size] ) )
471- . collect :: < Result < Vec < _ > , String > > ( ) ?
472- . into_iter ( )
473- . map ( Boxed ) . collect ( )
475+ . map ( |index| ptr. ty . unrepr ( & repr[ index * size..( index + 1 ) * size] ) )
476+ . collect :: < Result < Vec < _ > , String > > ( ) ?
477+ . into_iter ( )
478+ . map ( Boxed )
479+ . collect ( )
474480 } else {
475481 Value :: from_row_values_infallible (
476482 ( 0 ..len)
Original file line number Diff line number Diff line change @@ -364,14 +364,14 @@ impl Deref for Value {
364364 type Target = ValueRepr ;
365365 fn deref ( & self ) -> & Self :: Target {
366366 // Safety: The layout of `Value` should always match that of `Value`
367- unsafe { & * ( std:: ptr:: from_ref ( self ) as * const ValueRepr ) }
367+ unsafe { & * std:: ptr:: from_ref ( self ) . cast ( ) }
368368 }
369369}
370370
371371impl DerefMut for Value {
372372 fn deref_mut ( & mut self ) -> & mut Self :: Target {
373373 // Safety: The layout of `Value` should always match that of `Value`
374- unsafe { & mut * ( std:: ptr:: from_mut ( self ) as * mut ValueRepr ) }
374+ unsafe { & mut * std:: ptr:: from_mut ( self ) . cast ( ) }
375375 }
376376}
377377
You can’t perform that action at this time.
0 commit comments