Added str::char_offset_iter() and str::rev_char_offset_iter()
Renamed bytes_iter to byte_iter to match other iterators Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs Reordered the Iterator section Whitespace fixup Moved clunky `each_split_within` function to the one place in the tree where it's actually needed Replaced all block doccomments in str with line doccomments
This commit is contained in:
parent
d75ab4a5d7
commit
e33fca9ffe
7 changed files with 592 additions and 597 deletions
|
|
@ -16,7 +16,7 @@ pub fn main() {
|
|||
assert_eq!(y, 6);
|
||||
let s = ~"hello there";
|
||||
let mut i: int = 0;
|
||||
for s.bytes_iter().advance |c| {
|
||||
for s.byte_iter().advance |c| {
|
||||
if i == 0 { assert!((c == 'h' as u8)); }
|
||||
if i == 1 { assert!((c == 'e' as u8)); }
|
||||
if i == 2 { assert!((c == 'l' as u8)); }
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ pub fn main() {
|
|||
|
||||
fn check_str_eq(a: ~str, b: ~str) {
|
||||
let mut i: int = 0;
|
||||
for a.bytes_iter().advance |ab| {
|
||||
for a.byte_iter().advance |ab| {
|
||||
info!(i);
|
||||
info!(ab);
|
||||
let bb: u8 = b[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue