mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 22:01:18 -06:00
add missing rust annotations
This commit is contained in:
+2
-2
@@ -156,7 +156,7 @@ let slice = &s[1..];
|
||||
|
||||
With this in mind, let’s re-write `first_word()` to return a slice:
|
||||
|
||||
```
|
||||
```rust
|
||||
fn first_word(s: &String) -> &str {
|
||||
let bytes = s.as_bytes();
|
||||
|
||||
@@ -234,7 +234,7 @@ Remember how we talked about string literals being stored inside of the binary
|
||||
itself? Now that we know about slices, we can now properly understand string
|
||||
literals.
|
||||
|
||||
```
|
||||
```rust
|
||||
let s = "Hello, world!";
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user