From 18141062796119aef3e6aba028576672229ce3d0 Mon Sep 17 00:00:00 2001 From: xiaohulu Date: Mon, 17 Sep 2018 17:37:39 +0800 Subject: [PATCH] update ch04-03-slices.md --- src/ch04-03-slices.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ch04-03-slices.md b/src/ch04-03-slices.md index b2d5842..c4f5a58 100644 --- a/src/ch04-03-slices.md +++ b/src/ch04-03-slices.md @@ -229,16 +229,13 @@ let s = "Hello, world!"; #### 字符串 slice 作为参数 -Knowing that you can take slices of literals and `String` values leads us to -one more improvement on `first_word`, and that’s its signature: - 在知道了能够获取字面值和 `String` 的 slice 后,我们对 `first_word` 做了改进,这是它的签名: ```rust,ignore fn first_word(s: &String) -> &str { ``` -而更有经验的 Rustacean 会编写示例 4-9 中的签名,因为它使得可以对 `String` 值和 `&str` 值使用相同的函数: +而更有经验的 Rustacean 会编写出示例 4-9 中的签名,因为它使得可以对 `String` 值和 `&str` 值使用相同的函数: ```rust,ignore fn first_word(s: &str) -> &str {