@@ -106,7 +106,7 @@ unsafe trait GenericRadix: Sized {
106
106
// SAFETY: The only chars in `buf` are created by `Self::digit` which are assumed to be
107
107
// valid UTF-8
108
108
let buf = unsafe {
109
- str:: from_utf8_unchecked ( slice:: from_raw_parts ( buf. as_ptr ( ) . into_inner ( ) , buf. len ( ) ) )
109
+ str:: from_utf8_unchecked ( slice:: from_raw_parts ( buf. as_ptr ( ) . cast :: < u8 > ( ) , buf. len ( ) ) )
110
110
} ;
111
111
f. pad_integral ( is_nonnegative, Self :: PREFIX , buf)
112
112
}
@@ -213,7 +213,7 @@ macro_rules! impl_Display {
213
213
// 2^128 is about 3*10^38, so 39 gives an extra byte of space
214
214
let mut buf = [ MaybeUninit :: <u8 >:: uninit( ) ; 39 ] ;
215
215
let mut curr = buf. len( ) ;
216
- let buf_ptr = buf. as_mut_ptr( ) . into_inner ( ) ;
216
+ let buf_ptr = buf. as_mut_ptr( ) . cast :: < u8 > ( ) ;
217
217
let lut_ptr = DEC_DIGITS_LUT . as_ptr( ) ;
218
218
219
219
// SAFETY: Since `d1` and `d2` are always less than or equal to `198`, we
@@ -341,7 +341,7 @@ macro_rules! impl_Exp {
341
341
// that `curr >= 0`.
342
342
let mut buf = [ MaybeUninit :: <u8 >:: uninit( ) ; 40 ] ;
343
343
let mut curr = buf. len( ) ; //index for buf
344
- let buf_ptr = buf. as_mut_ptr( ) . into_inner ( ) ;
344
+ let buf_ptr = buf. as_mut_ptr( ) . cast :: < u8 > ( ) ;
345
345
let lut_ptr = DEC_DIGITS_LUT . as_ptr( ) ;
346
346
347
347
// decode 2 chars at a time
@@ -397,11 +397,11 @@ macro_rules! impl_Exp {
397
397
} else {
398
398
let off = exponent << 1 ;
399
399
// SAFETY: 1 + 2 <= 3
400
- unsafe { ptr:: copy_nonoverlapping( lut_ptr. add( off) , exp_buf. as_mut_ptr( ) . into_inner ( ) . add ( 1 ) , 2 ) ; }
400
+ unsafe { ptr:: copy_nonoverlapping( lut_ptr. add( off) , exp_buf. as_mut_ptr( ) . add ( 1 ) . cast :: < u8 > ( ) , 2 ) ; }
401
401
3
402
402
} ;
403
403
// SAFETY: max(2, 3) <= 3
404
- unsafe { slice:: from_raw_parts( exp_buf. as_mut_ptr( ) . into_inner ( ) , len) }
404
+ unsafe { slice:: from_raw_parts( exp_buf. as_mut_ptr( ) . cast :: < u8 > ( ) , len) }
405
405
} ;
406
406
407
407
let parts = & [
@@ -481,7 +481,7 @@ impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);
481
481
482
482
/// Helper function for writing a u64 into `buf` going from last to first, with `curr`.
483
483
fn parse_u64_into < const N : usize > ( mut n : u64 , buf : & mut [ MaybeUninit < u8 > ; N ] , curr : & mut usize ) {
484
- let buf_ptr = buf. as_mut_ptr ( ) . into_inner ( ) ;
484
+ let buf_ptr = buf. as_mut_ptr ( ) . cast :: < u8 > ( ) ;
485
485
let lut_ptr = DEC_DIGITS_LUT . as_ptr ( ) ;
486
486
assert ! ( * curr > 19 ) ;
487
487
@@ -628,7 +628,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
628
628
// UTF-8 since `DEC_DIGITS_LUT` is
629
629
let buf_slice = unsafe {
630
630
str:: from_utf8_unchecked ( slice:: from_raw_parts (
631
- buf. as_mut_ptr ( ) . add ( curr) . into_inner ( ) ,
631
+ buf. as_mut_ptr ( ) . add ( curr) . cast :: < u8 > ( ) ,
632
632
buf. len ( ) - curr,
633
633
) )
634
634
} ;
0 commit comments