We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 439d83d commit febca57Copy full SHA for febca57
library/core/src/str/mod.rs
@@ -720,7 +720,7 @@ impl str {
720
// is_char_boundary checks that the index is in [0, .len()]
721
if self.is_char_boundary(mid) {
722
// SAFETY: just checked that `mid` is on a char boundary.
723
- Some(unsafe { (self.get_unchecked(0..mid), self.get_unchecked(mid..self.len())) })
+ Some(unsafe { self.split_at_unchecked(mid) })
724
} else {
725
None
726
}
0 commit comments