Skip to content

Commit febca57

Browse files
committed
change split_at_checked to use split_at_unchecked internally
1 parent 439d83d commit febca57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ impl str {
720720
// is_char_boundary checks that the index is in [0, .len()]
721721
if self.is_char_boundary(mid) {
722722
// SAFETY: just checked that `mid` is on a char boundary.
723-
Some(unsafe { (self.get_unchecked(0..mid), self.get_unchecked(mid..self.len())) })
723+
Some(unsafe { self.split_at_unchecked(mid) })
724724
} else {
725725
None
726726
}

0 commit comments

Comments
 (0)