We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a14d72d commit 223f309Copy full SHA for 223f309
src/libcollections/list.rs
@@ -118,34 +118,6 @@ fn push<T:Clone>(ll: &mut @list<T>, vv: T) {
118
}
119
*/
120
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
136
-pub fn each<T>(list: @List<T>, f: |&T| -> bool) -> bool {
137
138
139
140
141
- if !f(head) { return false; }
142
143
144
- Nil => { return true; }
145
146
147
148
149
#[cfg(test)]
150
mod tests {
151
use list::{List, Nil, head, tail};
0 commit comments