fn main() { let mut s = String::from("hello world"); let word = first_word(&s); // 不可变借用 // s.clear(); // 错误:不能在有不可变引用时修改 s println!("{}", word); }