Use raw pointer casts for slice, str's .as_ptr()
We can now use raw pointer casts `*const [T] as *const T` and `*const str as *const u8` instead of .repr() for getting the pointer out of a slice.
This commit is contained in:
parent
09130044ce
commit
63c4065af0
2 changed files with 5 additions and 5 deletions
|
@ -1894,7 +1894,7 @@ impl StrExt for str {
|
|||
|
||||
#[inline]
|
||||
fn as_ptr(&self) -> *const u8 {
|
||||
self.repr().data
|
||||
self as *const str as *const u8
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue