File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2407,7 +2407,7 @@ impl str {
2407
2407
#[ stable( feature = "ascii_methods_on_intrinsics" , since = "1.23.0" ) ]
2408
2408
#[ inline]
2409
2409
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 .
2411
2411
let me = unsafe { self . as_bytes_mut ( ) } ;
2412
2412
me. make_ascii_uppercase ( )
2413
2413
}
@@ -2434,7 +2434,7 @@ impl str {
2434
2434
#[ stable( feature = "ascii_methods_on_intrinsics" , since = "1.23.0" ) ]
2435
2435
#[ inline]
2436
2436
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 .
2438
2438
let me = unsafe { self . as_bytes_mut ( ) } ;
2439
2439
me. make_ascii_lowercase ( )
2440
2440
}
You can’t perform that action at this time.
0 commit comments