From ab4c70bccf35c3ec530e0214c8fc344f9cc2a232 Mon Sep 17 00:00:00 2001 From: sparklelcm333 Date: Wed, 20 May 2026 21:29:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ownership/the_slice_type.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ownership/the_slice_type.md b/src/ownership/the_slice_type.md index 8978d34..2a9786a 100644 --- a/src/ownership/the_slice_type.md +++ b/src/ownership/the_slice_type.md @@ -78,11 +78,11 @@ fn first_word(s: &String) -> usize { fn main() { let mut s = String::from("The quick brown fox jumps over the lazy dog."); - let word = first_word(&s); // word 将得到值 5 + let word = first_word(&s); // word 将得到值 3 s.clear(); // 这会清空那个 String,令其等于 "" - // word 在这里仍有着值 5,但 s 已不再有咱们可对值 5 + // word 在这里仍有着值 3,但 s 已不再有咱们可对值 3 // 有意义地运用的任何内容。因此 word 现在完全无效! } ```