Skip to content

Commit 44770ae

Browse files
committed
Merge pull request #7595 from thestinger/iterator
remove some method resolve workarounds
2 parents 96ae000 + 641aec7 commit 44770ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+118
-118
lines changed

src/libextra/getopts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn name_str(nm: &Name) -> ~str {
176176
}
177177

178178
fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> {
179-
opts.iter().position_(|opt| opt.name == nm)
179+
opts.iter().position(|opt| opt.name == nm)
180180
}
181181

182182
/**

src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ impl serialize::Decoder for Decoder {
950950
}
951951
ref json => fail!("invalid variant: %?", *json),
952952
};
953-
let idx = match names.iter().position_(|n| str::eq_slice(*n, name)) {
953+
let idx = match names.iter().position(|n| str::eq_slice(*n, name)) {
954954
Some(idx) => idx,
955955
None => fail!("Unknown variant name: %?", name),
956956
};

src/libextra/net/ip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub mod v4 {
203203
}).collect();
204204
if parts.len() != 4 {
205205
Err(fmt!("'%s' doesn't have 4 parts", ip))
206-
} else if parts.iter().any_(|x| *x == 256u) {
206+
} else if parts.iter().any(|x| *x == 256u) {
207207
Err(fmt!("invalid octal in addr '%s'", ip))
208208
} else {
209209
Ok(Ipv4Rep {

src/libextra/net/url.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ fn get_authority(rawurl: &str) ->
522522
let host_is_end_plus_one: &fn() -> bool = || {
523523
let xs = ['?', '#', '/'];
524524
end+1 == len
525-
&& !xs.iter().any_(|x| *x == (rawurl[end] as char))
525+
&& !xs.iter().any(|x| *x == (rawurl[end] as char))
526526
};
527527

528528
// finish up

src/libextra/par.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ pub fn any<A:Copy + Send>(
136136
fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
137137
let mapped = map_slices(xs, || {
138138
let f = fn_factory();
139-
let result: ~fn(uint, &[A]) -> bool = |_, slice| slice.iter().any_(f);
139+
let result: ~fn(uint, &[A]) -> bool = |_, slice| slice.iter().any(f);
140140
result
141141
});
142-
mapped.iter().any_(|&x| x)
142+
mapped.iter().any(|&x| x)
143143
}

src/libextra/terminfo/parser/compiled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
294294

295295
// Find the offset of the NUL we want to go to
296296
let nulpos = string_table.slice(offset as uint, string_table_bytes as uint)
297-
.iter().position_(|&b| b == 0);
297+
.iter().position(|&b| b == 0);
298298
match nulpos {
299299
Some(len) => {
300300
string_map.insert(name.to_owned(),

src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ mod test_treemap {
844844
for 90.times {
845845
let k = rng.gen();
846846
let v = rng.gen();
847-
if !ctrl.iter().any_(|x| x == &(k, v)) {
847+
if !ctrl.iter().any(|x| x == &(k, v)) {
848848
assert!(map.insert(k, v));
849849
ctrl.push((k, v));
850850
check_structure(&map);

src/librustc/front/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub fn metas_in_cfg(cfg: &[@ast::meta_item],
194194

195195
if cfg_metas.iter().all(|c| c.is_empty()) { return true; }
196196

197-
cfg_metas.iter().any_(|cfg_meta| {
197+
cfg_metas.iter().any(|cfg_meta| {
198198
cfg_meta.iter().all(|cfg_mi| {
199199
match cfg_mi.node {
200200
ast::meta_list(s, ref it) if "not" == s

src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn get_used_crate_files(cstore: &CStore) -> ~[Path] {
102102
pub fn add_used_library(cstore: &mut CStore, lib: @str) -> bool {
103103
assert!(!lib.is_empty());
104104

105-
if cstore.used_libraries.iter().any_(|x| x == &lib) { return false; }
105+
if cstore.used_libraries.iter().any(|x| x == &lib) { return false; }
106106
cstore.used_libraries.push(lib);
107107
true
108108
}

src/librustc/middle/borrowck/move_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl FlowedMoveData {
506506
for self.dfcx_moves.each_bit_on_entry_frozen(id) |index| {
507507
let move = &self.move_data.moves[index];
508508
let moved_path = move.path;
509-
if base_indices.iter().any_(|x| x == &moved_path) {
509+
if base_indices.iter().any(|x| x == &moved_path) {
510510
// Scenario 1 or 2: `loan_path` or some base path of
511511
// `loan_path` was moved.
512512
if !f(move, self.move_data.path(moved_path).loan_path) {
@@ -535,7 +535,7 @@ impl FlowedMoveData {
535535
-> bool {
536536
//! True if `id` is the id of the LHS of an assignment
537537
538-
self.move_data.assignee_ids.iter().any_(|x| x == &id)
538+
self.move_data.assignee_ids.iter().any(|x| x == &id)
539539
}
540540

541541
pub fn each_assignment_of(&self,

0 commit comments

Comments
 (0)