Skip to content

Commit 28fa3d1

Browse files
authored
Merge pull request #1999 from Zoybean/patch-4
Update Ch19.1 on slice splitting
2 parents 405ff3b + b3738eb commit 28fa3d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ch19-01-unsafe-rust.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
251251
This function first gets the total length of the slice. Then it asserts that
252252
the index given as a parameter is within the slice by checking whether it’s
253253
less than or equal to the length. The assertion means that if we pass an index
254-
that is greater than the index to split the slice at, the function will panic
254+
that is greater than the length to split the slice at, the function will panic
255255
before it attempts to use that index.
256256

257257
Then we return two mutable slices in a tuple: one from the start of the

0 commit comments

Comments
 (0)