librustc: Remove uses of advance.

This commit is contained in:
Luqman Aden 2014-06-12 06:14:15 -04:00 committed by Luqman Aden
parent 9e123c4056
commit f61472d743
3 changed files with 5 additions and 5 deletions

View File

@ -207,12 +207,12 @@ impl<N,E> Graph<N,E> {
pub fn each_node<'a>(&'a self, f: |NodeIndex, &'a Node<N>| -> bool) -> bool {
//! Iterates over all edges defined in the graph.
self.nodes.iter().enumerate().advance(|(i, node)| f(NodeIndex(i), node))
self.nodes.iter().enumerate().all(|(i, node)| f(NodeIndex(i), node))
}
pub fn each_edge<'a>(&'a self, f: |EdgeIndex, &'a Edge<E>| -> bool) -> bool {
//! Iterates over all edges defined in the graph
self.edges.iter().enumerate().advance(|(i, edge)| f(EdgeIndex(i), edge))
self.edges.iter().enumerate().all(|(i, edge)| f(EdgeIndex(i), edge))
}
pub fn each_outgoing_edge<'a>(&'a self,

View File

@ -5149,7 +5149,7 @@ impl<'a> Resolver<'a> {
}
_ => {
let mut method_scope = false;
self.value_ribs.borrow().iter().rev().advance(|rib| {
self.value_ribs.borrow().iter().rev().all(|rib| {
let res = match *rib {
Rib { bindings: _, kind: MethodRibKind(_, _) } => true,
Rib { bindings: _, kind: ItemRibKind } => false,

View File

@ -3887,13 +3887,13 @@ pub fn lookup_trait_def(cx: &ctxt, did: ast::DefId) -> Rc<ty::TraitDef> {
pub fn each_attr(tcx: &ctxt, did: DefId, f: |&ast::Attribute| -> bool) -> bool {
if is_local(did) {
let item = tcx.map.expect_item(did.node);
item.attrs.iter().advance(|attr| f(attr))
item.attrs.iter().all(|attr| f(attr))
} else {
info!("getting foreign attrs");
let mut cont = true;
csearch::get_item_attrs(&tcx.sess.cstore, did, |attrs| {
if cont {
cont = attrs.iter().advance(|attr| f(attr));
cont = attrs.iter().all(|attr| f(attr));
}
});
info!("done");