File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -259,9 +259,9 @@ impl OwnedAsciiCast for Vec<u8> {
259
259
260
260
#[ inline]
261
261
unsafe fn into_ascii_nocheck ( self ) -> Vec < Ascii > {
262
- let v = Vec :: from_raw_parts ( self . len ( ) ,
263
- self . capacity ( ) ,
264
- mem :: transmute ( self . as_ptr ( ) ) ) ;
262
+ let v = Vec :: from_raw_parts ( self . as_ptr ( ) as * mut Ascii ,
263
+ self . len ( ) ,
264
+ self . capacity ( ) ) ;
265
265
266
266
// We forget `self` to avoid freeing it at the end of the scope
267
267
// Otherwise, the returned `Vec` would point to freed memory
@@ -345,9 +345,9 @@ pub trait IntoBytes {
345
345
impl IntoBytes for Vec < Ascii > {
346
346
fn into_bytes ( self ) -> Vec < u8 > {
347
347
unsafe {
348
- let v = Vec :: from_raw_parts ( self . len ( ) ,
349
- self . capacity ( ) ,
350
- mem :: transmute ( self . as_ptr ( ) ) ) ;
348
+ let v = Vec :: from_raw_parts ( self . as_ptr ( ) as * mut u8 ,
349
+ self . len ( ) ,
350
+ self . capacity ( ) ) ;
351
351
352
352
// We forget `self` to avoid freeing it at the end of the scope
353
353
// Otherwise, the returned `Vec` would point to freed memory
You can’t perform that action at this time.
0 commit comments