From 091e57a38b457d99a424d89f6ce7b6176ee75290 Mon Sep 17 00:00:00 2001 From: Aimer Neige Date: Sun, 19 Jun 2022 00:43:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 联系上下文,这里应该是要表达否定含义 --- src/basic/compound-type/string-slice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/compound-type/string-slice.md b/src/basic/compound-type/string-slice.md index b96c1238..32199c04 100644 --- a/src/basic/compound-type/string-slice.md +++ b/src/basic/compound-type/string-slice.md @@ -99,7 +99,7 @@ let slice = &s[..]; 字符串切片的类型标识是 `&str`,因此我们可以这样声明一个函数,输入 `String` 类型,返回它的切片: `fn first_word(s: &String) -> &str `。 -有了切片就可以写出这样的安全代码: +有了切片就可以写出这样的不安全代码: ```rust fn main() { From a7124948fccae23c2e5962f353f4d0c400e22c34 Mon Sep 17 00:00:00 2001 From: Sunface Date: Mon, 20 Jun 2022 08:30:09 +0800 Subject: [PATCH 2/2] Update src/basic/compound-type/string-slice.md --- src/basic/compound-type/string-slice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/compound-type/string-slice.md b/src/basic/compound-type/string-slice.md index 32199c04..7acdb36f 100644 --- a/src/basic/compound-type/string-slice.md +++ b/src/basic/compound-type/string-slice.md @@ -99,7 +99,7 @@ let slice = &s[..]; 字符串切片的类型标识是 `&str`,因此我们可以这样声明一个函数,输入 `String` 类型,返回它的切片: `fn first_word(s: &String) -> &str `。 -有了切片就可以写出这样的不安全代码: +有了切片就可以写出这样的代码: ```rust fn main() {