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"
19
19
pedantic = {level = " warn" , priority = -1 }
20
20
inline_always = " allow" # TODO: benchmark inlines
21
21
missing_panics_doc = " allow" # TODO
22
- ptr_as_ptr = " allow" # 3
23
22
similar_names = " allow" # 26
24
23
float_cmp = " allow" # 41
25
24
map_unwrap_or = " allow" # 56
Original file line number Diff line number Diff line change @@ -334,7 +334,12 @@ mod enabled {
334
334
let mut out_values = out_values;
335
335
out_values. pop ( ) . unwrap ( )
336
336
} 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 ( )
338
343
}
339
344
} ;
340
345
@@ -420,7 +425,7 @@ mod enabled {
420
425
libffi:: raw:: ffi_call (
421
426
cif. as_raw_ptr ( ) ,
422
427
Some ( * fun. as_safe_fun ( ) ) ,
423
- result. as_mut_ptr ( ) as * mut c_void ,
428
+ result. as_mut_ptr ( ) . cast ( ) ,
424
429
args. as_ptr ( ) as * mut * mut c_void ,
425
430
) ;
426
431
result
@@ -467,10 +472,11 @@ mod enabled {
467
472
FfiType :: ULongLong => arr ! ( c_ulonglong) ,
468
473
_ => Ok ( if ptr. ty . is_string ( ) {
469
474
( 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 ( )
474
480
} else {
475
481
Value :: from_row_values_infallible (
476
482
( 0 ..len)
Original file line number Diff line number Diff line change @@ -364,14 +364,14 @@ impl Deref for Value {
364
364
type Target = ValueRepr ;
365
365
fn deref ( & self ) -> & Self :: Target {
366
366
// 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 ( ) }
368
368
}
369
369
}
370
370
371
371
impl DerefMut for Value {
372
372
fn deref_mut ( & mut self ) -> & mut Self :: Target {
373
373
// 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 ( ) }
375
375
}
376
376
}
377
377
You can’t perform that action at this time.
0 commit comments