Merge pull request #927 from aimerneige/patch-3

错误修正
pull/934/head
Sunface 2 years ago committed by GitHub
commit b5cde88123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -99,7 +99,7 @@ let slice = &s[..];
字符串切片的类型标识是 `&str`,因此我们可以这样声明一个函数,输入 `String` 类型,返回它的切片: `fn first_word(s: &String) -> &str `
有了切片就可以写出这样的安全代码:
有了切片就可以写出这样的代码:
```rust
fn main() {

Loading…
Cancel
Save