Skip to content

Commit

Permalink
Removed deprecated list::{iter,each}() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Feb 27, 2014
1 parent a14d72d commit 223f309
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/libcollections/list.rs
Expand Up @@ -118,34 +118,6 @@ fn push<T:Clone>(ll: &mut @list<T>, vv: T) {
}
*/

/// Iterate over a list
pub fn iter<T>(list: @List<T>, f: |&T|) {
let mut cur = list;
loop {
cur = match *cur {
Cons(ref head, tail) => {
f(head);
tail
}
Nil => break
}
}
}

/// Iterate over a list
pub fn each<T>(list: @List<T>, f: |&T| -> bool) -> bool {
let mut cur = list;
loop {
cur = match *cur {
Cons(ref head, tail) => {
if !f(head) { return false; }
tail
}
Nil => { return true; }
}
}
}

#[cfg(test)]
mod tests {
use list::{List, Nil, head, tail};
Expand Down

0 comments on commit 223f309

Please sign in to comment.