Merge pull request #655 from Shinolr/main

Update ch04-03-slices.md
pull/656/head
KaiserY 2 years ago committed by GitHub
commit 173ed4adc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -169,7 +169,7 @@ let s = "Hello, world!";
fn first_word(s: &String) -> &str { fn first_word(s: &String) -> &str {
``` ```
而更有经验的 Rustacean 会编写出示例 4-9 中的签名,因为它使得可以对 `String` 值和 `&str` 值使用相同的函数: 而更有经验的 Rustacean 会编写出示例 4-9 中的签名,因为它使得可以对 `&String` 值和 `&str` 值使用相同的函数:
```rust,ignore ```rust,ignore
{{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-09/src/main.rs:here}} {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-09/src/main.rs:here}}

Loading…
Cancel
Save