Skip to content

Commit 223f309

Browse files
committed
Removed deprecated list::{iter,each}() functions
1 parent a14d72d commit 223f309

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/libcollections/list.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -118,34 +118,6 @@ fn push<T:Clone>(ll: &mut @list<T>, vv: T) {
118118
}
119119
*/
120120

121-
/// Iterate over a list
122-
pub fn iter<T>(list: @List<T>, f: |&T|) {
123-
let mut cur = list;
124-
loop {
125-
cur = match *cur {
126-
Cons(ref head, tail) => {
127-
f(head);
128-
tail
129-
}
130-
Nil => break
131-
}
132-
}
133-
}
134-
135-
/// Iterate over a list
136-
pub fn each<T>(list: @List<T>, f: |&T| -> bool) -> bool {
137-
let mut cur = list;
138-
loop {
139-
cur = match *cur {
140-
Cons(ref head, tail) => {
141-
if !f(head) { return false; }
142-
tail
143-
}
144-
Nil => { return true; }
145-
}
146-
}
147-
}
148-
149121
#[cfg(test)]
150122
mod tests {
151123
use list::{List, Nil, head, tail};

0 commit comments

Comments
 (0)