Skip to content

Commit

Permalink
changed .each() to .iter().advance()
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Reed committed Jul 8, 2013
1 parent 6b2abca commit 5e0be46
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/libstd/rt/uv/net.rs
Expand Up @@ -106,16 +106,16 @@ fn uv_ip_as_ip<T>(addr: UvIpAddr, f: &fn(IpAddr) -> T) -> T {
},
UvIpv6(*) => {
let ip: ~[u16] = {
let read_hex_segment = |s: &str| -> u16 {
num::FromStrRadix::from_str_radix(s, 16u).unwrap()
};
let convert_each_segment = |s: &str| -> ~[u16] {
match s {
"" => ~[],
s => s.split_iter(':').transform(read_hex_segment).collect(),
}
};
let expand_shorthand_and_convert = |s: &str| -> ~[~[u16]] {
let convert_each_segment = |s: &str| -> ~[u16] {
let read_hex_segment = |s: &str| -> u16 {
num::FromStrRadix::from_str_radix(s, 16u).unwrap()
};
match s {
"" => ~[],
s => s.split_iter(':').transform(read_hex_segment).collect(),
}
};
s.split_str_iter("::").transform(convert_each_segment).collect()
};
match expand_shorthand_and_convert(ip_str) {
Expand Down Expand Up @@ -662,7 +662,7 @@ mod test {
if status.is_none() {
rtdebug!("got %d bytes", nread);
let buf = buf.unwrap();
for buf.slice(0, nread as uint).each |byte| {
for buf.slice(0, nread as uint).iter().advance() |byte| {
assert!(*byte == count as u8);
rtdebug!("%u", *byte as uint);
count += 1;
Expand Down

0 comments on commit 5e0be46

Please sign in to comment.