From 11ed1dedc2266f7f5c2553ca4b487ffd17e579cd Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 22 Jan 2016 10:32:27 -0500 Subject: [PATCH] add missing rust annotations --- src/slices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slices.md b/src/slices.md index 800ec94b8..19d9438e5 100644 --- a/src/slices.md +++ b/src/slices.md @@ -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!"; ```