Merge pull request #441 from blattgold/master-1

slice.md, fixed gramatical error
This commit is contained in:
Sunface
2023-08-11 10:51:33 +08:00
committed by GitHub

View File

@ -85,7 +85,7 @@ fn main() {
let mut s = String::from("hello world");
// Here, &s is `&String` type, but `first_word` need a `&str` type.
// It works because `&String` can be implicitly converted to `&str. If you want know more, this is called `Deref coercion`.
// It works because `&String` can be implicitly converted to `&str. If you want to know more, this is called `Deref coercion`.
let word = first_word(&s);
s.clear(); // error!