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> {
381381 Ok ( unsafe { from_utf8_unchecked_mut ( v) } )
382382}
383383
384-
385384#[ repr( C ) ]
386385union StrOrSlice < ' a > {
387386 str : & ' a str ,
388387 slice : & ' a [ u8 ] ,
389388}
390389
391-
392-
393390/// Converts a slice of bytes to a string slice without checking
394391/// that the string contains valid UTF-8.
395392///
@@ -429,10 +426,9 @@ union StrOrSlice<'a> {
429426pub const unsafe fn from_utf8_unchecked ( v : & [ u8 ] ) -> & str {
430427 // SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
431428 // Also relies on `&str` and `&[u8]` having the same layout.
432- unsafe { StrOrSlice { slice : v } . str }
429+ unsafe { StrOrSlice { slice : v } . str }
433430}
434431
435-
436432/// Converts a slice of bytes to a string slice without checking
437433/// that the string contains valid UTF-8; mutable version.
438434///
You can’t perform that action at this time.
0 commit comments