Skip to content

Commit 9fbcf16

Browse files
Add missing quotes for the types in comments.
1 parent c94a692 commit 9fbcf16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/std/str.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Or maybe you want an array of bytes that's mostly text? Byte strings to the resc
119119
use std::str;
120120
121121
fn main() {
122-
// Note that this is not actually a &str
122+
// Note that this is not actually a `&str`
123123
let bytestring: &[u8; 20] = b"this is a bytestring";
124124
125125
// Byte arrays don't have the `Display` trait, so printing them is a bit limited
@@ -136,7 +136,7 @@ fn main() {
136136
let raw_bytestring = br"\u{211D} is not escaped here";
137137
println!("{:?}", raw_bytestring);
138138
139-
// Converting a byte array to str can fail
139+
// Converting a byte array to `str` can fail
140140
if let Ok(my_str) = str::from_utf8(raw_bytestring) {
141141
println!("And the same as text: '{}'", my_str);
142142
}
@@ -147,7 +147,7 @@ fn main() {
147147
// Bytestrings don't have to be UTF-8
148148
let shift_jis = b"\x82\xe6\x82\xa8\x82\xb1\x82"; // "ようこそ" in SHIFT-JIS
149149
150-
// But then they can't always be converted to str
150+
// But then they can't always be converted to `str`
151151
match str::from_utf8(shift_jis) {
152152
Ok(my_str) => println!("Conversion successful: '{}'", my_str),
153153
Err(e) => println!("Conversion failed: {:?}", e),

0 commit comments

Comments
 (0)