Skip to content

Commit 1db62d8

Browse files
committed
std: Iterator.chain_ -> .chain
1 parent 60c2661 commit 1db62d8

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/librustc/middle/trans/monomorphize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,12 @@ pub fn make_mono_id(ccx: @mut CrateContext,
366366
param_uses: Option<@~[type_use::type_uses]>) -> mono_id {
367367
// FIXME (possibly #5801): Need a lot of type hints to get
368368
// .collect() to work.
369-
let substs_iter = substs.self_ty.iter().chain_(substs.tys.iter());
369+
let substs_iter = substs.self_ty.iter().chain(substs.tys.iter());
370370
let precise_param_ids: ~[(ty::t, Option<@~[mono_id]>)] = match substs.vtables {
371371
Some(vts) => {
372372
debug!("make_mono_id vtables=%s substs=%s",
373373
vts.repr(ccx.tcx), substs.tys.repr(ccx.tcx));
374-
let vts_iter = substs.self_vtables.iter().chain_(vts.iter());
374+
let vts_iter = substs.self_vtables.iter().chain(vts.iter());
375375
vts_iter.zip(substs_iter).map(|(vtable, subst)| {
376376
let v = vtable.map(|vt| meth::vtable_id(ccx, vt));
377377
(*subst, if !v.is_empty() { Some(@v) } else { None })
@@ -387,7 +387,7 @@ pub fn make_mono_id(ccx: @mut CrateContext,
387387
// We just say it is fully used.
388388
let self_use =
389389
substs.self_ty.map(|_| type_use::use_repr|type_use::use_tydesc);
390-
let uses_iter = self_use.iter().chain_(uses.iter());
390+
let uses_iter = self_use.iter().chain(uses.iter());
391391

392392
precise_param_ids.iter().zip(uses_iter).map(|(id, uses)| {
393393
if ccx.sess.no_monomorphic_collapse() {

src/libstd/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ impl<T:Hash + Eq> HashSet<T> {
724724
/// Visit the values representing the symmetric difference
725725
pub fn symmetric_difference_iter<'a>(&'a self, other: &'a HashSet<T>)
726726
-> Chain<SetAlgebraIter<'a, T>, SetAlgebraIter<'a, T>> {
727-
self.difference_iter(other).chain_(other.difference_iter(self))
727+
self.difference_iter(other).chain(other.difference_iter(self))
728728
}
729729

730730
/// Visit the values representing the intersection
@@ -740,7 +740,7 @@ impl<T:Hash + Eq> HashSet<T> {
740740
/// Visit the values representing the union
741741
pub fn union_iter<'a>(&'a self, other: &'a HashSet<T>)
742742
-> Chain<HashSetIterator<'a, T>, SetAlgebraIter<'a, T>> {
743-
self.iter().chain_(other.difference_iter(self))
743+
self.iter().chain(other.difference_iter(self))
744744
}
745745

746746
}

src/libstd/iterator.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ pub trait Iterator<A> {
5959
/// ~~~ {.rust}
6060
/// let a = [0];
6161
/// let b = [1];
62-
/// let mut it = a.iter().chain_(b.iter());
62+
/// let mut it = a.iter().chain(b.iter());
6363
/// assert_eq!(it.next().get(), &0);
6464
/// assert_eq!(it.next().get(), &1);
6565
/// assert!(it.next().is_none());
6666
/// ~~~
6767
#[inline]
68-
fn chain_<U: Iterator<A>>(self, other: U) -> Chain<Self, U> {
68+
fn chain<U: Iterator<A>>(self, other: U) -> Chain<Self, U> {
6969
Chain{a: self, b: other, flag: false}
7070
}
7171

@@ -1534,7 +1534,7 @@ mod tests {
15341534
let xs = [0u, 1, 2, 3, 4, 5];
15351535
let ys = [30u, 40, 50, 60];
15361536
let expected = [0, 1, 2, 3, 4, 5, 30, 40, 50, 60];
1537-
let mut it = xs.iter().chain_(ys.iter());
1537+
let mut it = xs.iter().chain(ys.iter());
15381538
let mut i = 0;
15391539
for &x in it {
15401540
assert_eq!(x, expected[i]);
@@ -1543,7 +1543,7 @@ mod tests {
15431543
assert_eq!(i, expected.len());
15441544

15451545
let ys = count(30u, 10).take(4);
1546-
let mut it = xs.iter().map(|&x| x).chain_(ys);
1546+
let mut it = xs.iter().map(|&x| x).chain(ys);
15471547
let mut i = 0;
15481548
for x in it {
15491549
assert_eq!(x, expected[i]);
@@ -1771,7 +1771,7 @@ mod tests {
17711771
assert_eq!(c.take_while(|_| false).size_hint(), (0, None));
17721772
assert_eq!(c.skip_while(|_| false).size_hint(), (0, None));
17731773
assert_eq!(c.enumerate().size_hint(), (uint::max_value, None));
1774-
assert_eq!(c.chain_(vi.map(|&i| i)).size_hint(), (uint::max_value, None));
1774+
assert_eq!(c.chain(vi.map(|&i| i)).size_hint(), (uint::max_value, None));
17751775
assert_eq!(c.zip(vi).size_hint(), (10, Some(10)));
17761776
assert_eq!(c.scan(0, |_,_| Some(0)).size_hint(), (0, None));
17771777
assert_eq!(c.filter(|_| false).size_hint(), (0, None));
@@ -1785,7 +1785,7 @@ mod tests {
17851785
assert_eq!(vi.take_while(|_| false).size_hint(), (0, Some(10)));
17861786
assert_eq!(vi.skip_while(|_| false).size_hint(), (0, Some(10)));
17871787
assert_eq!(vi.enumerate().size_hint(), (10, Some(10)));
1788-
assert_eq!(vi.chain_(v2.iter()).size_hint(), (13, Some(13)));
1788+
assert_eq!(vi.chain(v2.iter()).size_hint(), (13, Some(13)));
17891789
assert_eq!(vi.zip(v2.iter()).size_hint(), (3, Some(3)));
17901790
assert_eq!(vi.scan(0, |_,_| Some(0)).size_hint(), (0, Some(10)));
17911791
assert_eq!(vi.filter(|_| false).size_hint(), (0, Some(10)));
@@ -1900,7 +1900,7 @@ mod tests {
19001900
fn test_double_ended_chain() {
19011901
let xs = [1, 2, 3, 4, 5];
19021902
let ys = ~[7, 9, 11];
1903-
let mut it = xs.iter().chain_(ys.iter()).invert();
1903+
let mut it = xs.iter().chain(ys.iter()).invert();
19041904
assert_eq!(it.next().unwrap(), &11)
19051905
assert_eq!(it.next().unwrap(), &9)
19061906
assert_eq!(it.next_back().unwrap(), &1)
@@ -1953,7 +1953,7 @@ mod tests {
19531953
fn test_random_access_chain() {
19541954
let xs = [1, 2, 3, 4, 5];
19551955
let ys = ~[7, 9, 11];
1956-
let mut it = xs.iter().chain_(ys.iter());
1956+
let mut it = xs.iter().chain(ys.iter());
19571957
assert_eq!(it.idx(0).unwrap(), &1);
19581958
assert_eq!(it.idx(5).unwrap(), &7);
19591959
assert_eq!(it.idx(7).unwrap(), &11);

src/libsyntax/ext/ifmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl Context {
576576
}
577577

578578
let args = names.move_iter().map(|a| a.unwrap());
579-
let mut args = locals.move_iter().chain_(args);
579+
let mut args = locals.move_iter().chain(args);
580580

581581
// Next, build up the actual call to the sprintf function.
582582
let result = self.ecx.expr_call_global(self.fmtsp, ~[

0 commit comments

Comments
 (0)