File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2407,7 +2407,7 @@ impl str {
24072407 #[ stable( feature = "ascii_methods_on_intrinsics" , since = "1.23.0" ) ]
24082408 #[ inline]
24092409 pub fn make_ascii_uppercase ( & mut self ) {
2410- // SAFETY: safe because we transmute two types with the same layout .
2410+ // SAFETY: changing ASCII letters only does not invalidate UTF-8 .
24112411 let me = unsafe { self . as_bytes_mut ( ) } ;
24122412 me. make_ascii_uppercase ( )
24132413 }
@@ -2434,7 +2434,7 @@ impl str {
24342434 #[ stable( feature = "ascii_methods_on_intrinsics" , since = "1.23.0" ) ]
24352435 #[ inline]
24362436 pub fn make_ascii_lowercase ( & mut self ) {
2437- // SAFETY: safe because we transmute two types with the same layout .
2437+ // SAFETY: changing ASCII letters only does not invalidate UTF-8 .
24382438 let me = unsafe { self . as_bytes_mut ( ) } ;
24392439 me. make_ascii_lowercase ( )
24402440 }
You can’t perform that action at this time.
0 commit comments