File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -381,15 +381,12 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
381
381
Ok ( unsafe { from_utf8_unchecked_mut ( v) } )
382
382
}
383
383
384
-
385
384
#[ repr( C ) ]
386
385
union StrOrSlice < ' a > {
387
386
str : & ' a str ,
388
387
slice : & ' a [ u8 ] ,
389
388
}
390
389
391
-
392
-
393
390
/// Converts a slice of bytes to a string slice without checking
394
391
/// that the string contains valid UTF-8.
395
392
///
@@ -429,10 +426,9 @@ union StrOrSlice<'a> {
429
426
pub const unsafe fn from_utf8_unchecked ( v : & [ u8 ] ) -> & str {
430
427
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
431
428
// Also relies on `&str` and `&[u8]` having the same layout.
432
- unsafe { StrOrSlice { slice : v } . str }
429
+ unsafe { StrOrSlice { slice : v } . str }
433
430
}
434
431
435
-
436
432
/// Converts a slice of bytes to a string slice without checking
437
433
/// that the string contains valid UTF-8; mutable version.
438
434
///
You can’t perform that action at this time.
0 commit comments