File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -285,12 +285,12 @@ impl<T> SliceExt for [T] {
285
285
286
286
#[ inline]
287
287
unsafe fn get_unchecked ( & self , index : usize ) -> & T {
288
- & * ( self . repr ( ) . data . offset ( index as isize ) )
288
+ & * ( self . as_ptr ( ) . offset ( index as isize ) )
289
289
}
290
290
291
291
#[ inline]
292
292
fn as_ptr ( & self ) -> * const T {
293
- self . repr ( ) . data
293
+ self as * const [ T ] as * const T
294
294
}
295
295
296
296
fn binary_search_by < F > ( & self , mut f : F ) -> Result < usize , usize > where
@@ -448,12 +448,12 @@ impl<T> SliceExt for [T] {
448
448
449
449
#[ inline]
450
450
unsafe fn get_unchecked_mut ( & mut self , index : usize ) -> & mut T {
451
- & mut * ( self . repr ( ) . data as * mut T ) . offset ( index as isize )
451
+ & mut * self . as_mut_ptr ( ) . offset ( index as isize )
452
452
}
453
453
454
454
#[ inline]
455
455
fn as_mut_ptr ( & mut self ) -> * mut T {
456
- self . repr ( ) . data as * mut T
456
+ self as * mut [ T ] as * mut T
457
457
}
458
458
459
459
#[ inline]
Original file line number Diff line number Diff line change @@ -1894,7 +1894,7 @@ impl StrExt for str {
1894
1894
1895
1895
#[ inline]
1896
1896
fn as_ptr ( & self ) -> * const u8 {
1897
- self . repr ( ) . data
1897
+ self as * const str as * const u8
1898
1898
}
1899
1899
1900
1900
#[ inline]
You can’t perform that action at this time.
0 commit comments