mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 19:54:34 -06:00
rebuild pages at 85fd039
This commit is contained in:
+4
-4
@@ -86,7 +86,7 @@ the word, though. Let’s try that:</p>
|
||||
let bytes = s.as_bytes();
|
||||
|
||||
for (i, &item) in bytes.iter().enumerate() {
|
||||
if byte == b' ' {
|
||||
if item == b' ' {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ that it will still be valid in the future. Consider this:</p>
|
||||
# let bytes = s.as_bytes();
|
||||
#
|
||||
# for (i, &item) in bytes.iter().enumerate() {
|
||||
# if byte == b' ' {
|
||||
# if item == b' ' {
|
||||
# return i;
|
||||
# }
|
||||
# }
|
||||
@@ -203,7 +203,7 @@ let slice = &s[..];
|
||||
let bytes = s.as_bytes();
|
||||
|
||||
for (i, &item) in bytes.iter().enumerate() {
|
||||
if byte == b' ' {
|
||||
if item == b' ' {
|
||||
return &s[0..i];
|
||||
}
|
||||
}
|
||||
@@ -274,7 +274,7 @@ with no loss of functionality:</p>
|
||||
# let bytes = s.as_bytes();
|
||||
#
|
||||
# for (i, &item) in bytes.iter().enumerate() {
|
||||
# if byte == b' ' {
|
||||
# if item == b' ' {
|
||||
# return &s[0..i];
|
||||
# }
|
||||
# }
|
||||
|
||||
+4
-4
@@ -2796,7 +2796,7 @@ the word, though. Let’s try that:</p>
|
||||
let bytes = s.as_bytes();
|
||||
|
||||
for (i, &item) in bytes.iter().enumerate() {
|
||||
if byte == b' ' {
|
||||
if item == b' ' {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -2838,7 +2838,7 @@ that it will still be valid in the future. Consider this:</p>
|
||||
# let bytes = s.as_bytes();
|
||||
#
|
||||
# for (i, &item) in bytes.iter().enumerate() {
|
||||
# if byte == b' ' {
|
||||
# if item == b' ' {
|
||||
# return i;
|
||||
# }
|
||||
# }
|
||||
@@ -2913,7 +2913,7 @@ let slice = &s[..];
|
||||
let bytes = s.as_bytes();
|
||||
|
||||
for (i, &item) in bytes.iter().enumerate() {
|
||||
if byte == b' ' {
|
||||
if item == b' ' {
|
||||
return &s[0..i];
|
||||
}
|
||||
}
|
||||
@@ -2984,7 +2984,7 @@ with no loss of functionality:</p>
|
||||
# let bytes = s.as_bytes();
|
||||
#
|
||||
# for (i, &item) in bytes.iter().enumerate() {
|
||||
# if byte == b' ' {
|
||||
# if item == b' ' {
|
||||
# return &s[0..i];
|
||||
# }
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user