diff --git a/ch04-03-slices.html b/ch04-03-slices.html index 7339f4b36..5b55247de 100644 --- a/ch04-03-slices.html +++ b/ch04-03-slices.html @@ -86,7 +86,7 @@ the word, though. Let’s try that:
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: # 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: # let bytes = s.as_bytes(); # # for (i, &item) in bytes.iter().enumerate() { -# if byte == b' ' { +# if item == b' ' { # return &s[0..i]; # } # } diff --git a/print.html b/print.html index 21bab8504..973c348cd 100644 --- a/print.html +++ b/print.html @@ -2796,7 +2796,7 @@ the word, though. Let’s try that: 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: # 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: # let bytes = s.as_bytes(); # # for (i, &item) in bytes.iter().enumerate() { -# if byte == b' ' { +# if item == b' ' { # return &s[0..i]; # } # }