File tree Expand file tree Collapse file tree 11 files changed +24
-28
lines changed Expand file tree Collapse file tree 11 files changed +24
-28
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ use cast;
24
24
use rt:: io:: Writer ;
25
25
use to_bytes:: IterBytes ;
26
26
use uint;
27
- use vec;
28
27
29
28
// Alias `SipState` to `State`.
30
29
pub use State = hash:: SipState ;
Original file line number Diff line number Diff line change @@ -484,7 +484,6 @@ mod tests {
484
484
485
485
use core:: cell:: Cell ;
486
486
use core:: task;
487
- use core:: vec;
488
487
489
488
#[ test]
490
489
fn manually_share_arc( ) {
@@ -683,7 +682,7 @@ mod tests {
683
682
}
684
683
685
684
// Wait for children to pass their asserts
686
- for vec :: each ( children) |r| {
685
+ for children. each |r| {
687
686
r. recv( ) ;
688
687
}
689
688
@@ -748,7 +747,7 @@ mod tests {
748
747
assert!( * state == 42 ) ;
749
748
* state = 31337 ;
750
749
// send to other readers
751
- for vec :: each ( reader_convos) |x| {
750
+ for reader_convos. each |x| {
752
751
match * x {
753
752
( ref rc, _) => rc. send( ( ) ) ,
754
753
}
@@ -757,7 +756,7 @@ mod tests {
757
756
let read_mode = arc. downgrade( write_mode) ;
758
757
do ( & read_mode) . read |state| {
759
758
// complete handshake with other readers
760
- for vec :: each ( reader_convos) |x| {
759
+ for reader_convos. each |x| {
761
760
match * x {
762
761
( _, ref rp) => rp. recv( ) ,
763
762
}
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ pub fn opt_count(mm: &Matches, nm: &str) -> uint {
368
368
369
369
/// Returns true if any of several options were matched
370
370
pub fn opts_present ( mm : & Matches , names : & [ ~str ] ) -> bool {
371
- for vec :: each ( names) |nm| {
371
+ for names. each |nm| {
372
372
match find_opt ( mm. opts , mkname ( * nm) ) {
373
373
Some ( id) if !mm. vals [ id] . is_empty ( ) => return true ,
374
374
_ => ( ) ,
@@ -395,7 +395,7 @@ pub fn opt_str(mm: &Matches, nm: &str) -> ~str {
395
395
* option took an argument
396
396
*/
397
397
pub fn opts_str ( mm : & Matches , names : & [ ~str ] ) -> ~str {
398
- for vec :: each ( names) |nm| {
398
+ for names. each |nm| {
399
399
match opt_val ( mm, * nm) {
400
400
Val ( copy s) => return s,
401
401
_ => ( )
Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ mod test {
425
425
let results = result::unwrap(ga_result);
426
426
debug!(" test_get_addr: Number of results for %s: %?",
427
427
localhost_name, vec::len(results));
428
- for vec::each( results) |r| {
428
+ for results.each |r| {
429
429
let ipv_prefix = match *r {
430
430
Ipv4(_) => ~" IPv4 ",
431
431
Ipv6(_) => ~" IPv6 "
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ pub fn sha1() -> @Sha1 {
250
250
fn result_str ( & mut self ) -> ~str {
251
251
let rr = mk_result ( self ) ;
252
252
let mut s = ~"";
253
- for vec :: each ( rr ) |b| {
253
+ for rr . each |b| {
254
254
let hex = uint:: to_str_radix ( * b as uint , 16 u) ;
255
255
if hex. len ( ) == 1 {
256
256
s += "0" ;
@@ -378,7 +378,7 @@ mod tests {
378
378
// Test that it works when accepting the message all at once
379
379
380
380
let mut sh = sha1:: sha1 ( ) ;
381
- for vec :: each ( tests) |t| {
381
+ for tests. each |t| {
382
382
sh. input_str ( t. input ) ;
383
383
let out = sh. result ( ) ;
384
384
check_vec_eq ( t. output , out) ;
@@ -392,7 +392,7 @@ mod tests {
392
392
393
393
394
394
// Test that it works when accepting the message in pieces
395
- for vec :: each ( tests) |t| {
395
+ for tests. each |t| {
396
396
let len = str:: len ( t. input ) ;
397
397
let mut left = len;
398
398
while left > 0 u {
Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ mod test_qsort {
859
859
let immut_names = names;
860
860
861
861
let pairs = vec::zip_slice(expected, immut_names);
862
- for vec::each( pairs) |p| {
862
+ for pairs.each |p| {
863
863
let (a, b) = *p;
864
864
debug!(" %d %d", a, b);
865
865
assert!((a == b));
Original file line number Diff line number Diff line change @@ -852,7 +852,7 @@ mod test_qsort {
852
852
let immut_names = names;
853
853
854
854
let pairs = vec::zip_slice(expected, immut_names);
855
- for vec::each( pairs) |p| {
855
+ for pairs.each |p| {
856
856
let (a, b) = *p;
857
857
debug!(" %d %d", a, b);
858
858
assert!((a == b));
Original file line number Diff line number Diff line change @@ -997,7 +997,7 @@ mod tests {
997
997
}
998
998
}
999
999
}
1000
- for vec::each( sibling_convos) |p| {
1000
+ for sibling_convos.each |p| {
1001
1001
let _ = p.recv(); // wait for sibling to get in the mutex
1002
1002
}
1003
1003
do m2.lock { }
Original file line number Diff line number Diff line change 13
13
use core:: io;
14
14
use core:: option;
15
15
use core:: os;
16
- use core:: vec;
17
16
18
17
// FIXME (#2807): Windows support.
19
18
@@ -50,7 +49,7 @@ pub fn color_supported() -> bool {
50
49
~"screen-bce", ~"xterm-256 color"] ;
51
50
return match os:: getenv ( ~"TERM ") {
52
51
option:: Some ( ref env) => {
53
- for vec :: each ( supported_terms) |term| {
52
+ for supported_terms. each |term| {
54
53
if * term == * env { return true ; }
55
54
}
56
55
false
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ fn print_failures(st: &ConsoleTestState) {
355
355
failures.push(name.to_str());
356
356
}
357
357
sort::tim_sort(failures);
358
- for vec::each( failures) |name| {
358
+ for failures.each |name| {
359
359
st.out.write_line(fmt!(" %s", name.to_str()));
360
360
}
361
361
}
@@ -928,7 +928,7 @@ mod tests {
928
928
{
929
929
fn testfn() { }
930
930
let mut tests = ~[];
931
- for vec::each( names) |name| {
931
+ for names.each |name| {
932
932
let test = TestDescAndFn {
933
933
desc: TestDesc {
934
934
name: DynTestName(*name),
@@ -954,7 +954,7 @@ mod tests {
954
954
955
955
let pairs = vec:: zip( expected, filtered) ;
956
956
957
- for vec :: each ( pairs) |p| {
957
+ for pairs. each |p| {
958
958
match * p {
959
959
( ref a, ref b) => {
960
960
assert!( ( * a == b. desc. name. to_str( ) ) ) ;
Original file line number Diff line number Diff line change @@ -861,7 +861,6 @@ mod tests {
861
861
use core:: result;
862
862
use core:: result:: { Err , Ok } ;
863
863
use core:: str;
864
- use core:: vec;
865
864
866
865
fn test_get_time ( ) {
867
866
static some_recent_date: i64 = 1325376000i64 ; // 2012-01-01T00:00:00Z
@@ -1028,31 +1027,31 @@ mod tests {
1028
1027
}
1029
1028
}
1030
1029
1031
- for vec::each( [
1030
+ for [
1032
1031
~" Sunday ",
1033
1032
~" Monday ",
1034
1033
~" Tuesday ",
1035
1034
~" Wednesday ",
1036
1035
~" Thursday ",
1037
1036
~" Friday ",
1038
1037
~" Saturday "
1039
- ]) |day| {
1038
+ ].each |day| {
1040
1039
assert!(test(*day, ~" %A "));
1041
1040
}
1042
1041
1043
- for vec::each( [
1042
+ for [
1044
1043
~" Sun ",
1045
1044
~" Mon ",
1046
1045
~" Tue ",
1047
1046
~" Wed ",
1048
1047
~" Thu ",
1049
1048
~" Fri ",
1050
1049
~" Sat "
1051
- ]) |day| {
1050
+ ].each |day| {
1052
1051
assert!(test(*day, ~" %a"));
1053
1052
}
1054
1053
1055
- for vec::each( [
1054
+ for [
1056
1055
~" January ",
1057
1056
~" February ",
1058
1057
~" March ",
@@ -1065,11 +1064,11 @@ mod tests {
1065
1064
~" October ",
1066
1065
~" November ",
1067
1066
~" December "
1068
- ]) |day| {
1067
+ ].each |day| {
1069
1068
assert!(test(*day, ~" %B "));
1070
1069
}
1071
1070
1072
- for vec::each( [
1071
+ for [
1073
1072
~" Jan ",
1074
1073
~" Feb ",
1075
1074
~" Mar ",
@@ -1082,7 +1081,7 @@ mod tests {
1082
1081
~" Oct ",
1083
1082
~" Nov ",
1084
1083
~" Dec "
1085
- ]) |day| {
1084
+ ].each |day| {
1086
1085
assert!(test(*day, ~" %b"));
1087
1086
}
1088
1087
You can’t perform that action at this time.
0 commit comments