From b3738eb0de03cce538c3f86a79784f0cbe11f74a Mon Sep 17 00:00:00 2001 From: Zoey Hewll Date: Tue, 18 Jun 2019 13:21:01 +0800 Subject: [PATCH] Update Ch19.1 on slice splitting resolves issue #1995 --- src/ch19-01-unsafe-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch19-01-unsafe-rust.md b/src/ch19-01-unsafe-rust.md index 8605ede6a2..b90cc92ba4 100644 --- a/src/ch19-01-unsafe-rust.md +++ b/src/ch19-01-unsafe-rust.md @@ -250,7 +250,7 @@ fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { This function first gets the total length of the slice. Then it asserts that the index given as a parameter is within the slice by checking whether it’s less than or equal to the length. The assertion means that if we pass an index -that is greater than the index to split the slice at, the function will panic +that is greater than the length to split the slice at, the function will panic before it attempts to use that index. Then we return two mutable slices in a tuple: one from the start of the