Skip to content

Commit ff273c4

Browse files
Fix inconsistend use of the byte string phrase.
I have changed all instances of `bytestring` into `byte string`. The latter form seems to be the proper one. Language documentation also use `byte slice` naming, but I'm not sure it's a reference to the same thing, so I'm open to feedback from the community.
1 parent 9fbcf16 commit ff273c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/std/str.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,19 @@ use std::str;
120120
121121
fn main() {
122122
// Note that this is not actually a `&str`
123-
let bytestring: &[u8; 20] = b"this is a bytestring";
123+
let bytestring: &[u8; 20] = b"this is a byte string";
124124
125125
// Byte arrays don't have the `Display` trait, so printing them is a bit limited
126-
println!("A bytestring: {:?}", bytestring);
126+
println!("A byte string: {:?}", bytestring);
127127
128-
// Bytestrings can have byte escapes...
128+
// Byte strings can have byte escapes...
129129
let escaped = b"\x52\x75\x73\x74 as bytes";
130130
// ...but no unicode escapes
131131
// let escaped = b"\u{211D} is not allowed";
132132
println!("Some escaped bytes: {:?}", escaped);
133133
134134
135-
// Raw bytestrings work just like raw strings
135+
// Raw byte strings work just like raw strings
136136
let raw_bytestring = br"\u{211D} is not escaped here";
137137
println!("{:?}", raw_bytestring);
138138
@@ -144,7 +144,7 @@ fn main() {
144144
let quotes = br#"You can also use "fancier" formatting, \
145145
like with normal raw strings"#;
146146
147-
// Bytestrings don't have to be UTF-8
147+
// Byte strings don't have to be UTF-8
148148
let shift_jis = b"\x82\xe6\x82\xa8\x82\xb1\x82"; // "ようこそ" in SHIFT-JIS
149149
150150
// But then they can't always be converted to `str`

0 commit comments

Comments
 (0)