Skip to content

Commit aa93e6e

Browse files
committed
libextra: Remove MutList, as it's inexorably tied to @mut
1 parent 84e977c commit aa93e6e

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/libextra/list.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ pub enum List<T> {
1919
Nil,
2020
}
2121

22-
#[deriving(Eq)]
23-
#[allow(missing_doc)]
24-
pub enum MutList<T> {
25-
MutCons(T, @mut MutList<T>),
26-
MutNil,
27-
}
28-
2922
/// Create a list from a vector
3023
pub fn from_vec<T:Clone + 'static>(v: &[T]) -> @List<T> {
3124
v.rev_iter().fold(@Nil::<T>, |t, h| @Cons((*h).clone(), t))
@@ -158,26 +151,6 @@ pub fn each<T>(l: @List<T>, f: |&T| -> bool) -> bool {
158151
}
159152
}
160153

161-
impl<T> MutList<T> {
162-
/// Iterate over a mutable list
163-
pub fn each(@mut self, f: |&mut T| -> bool) -> bool {
164-
let mut cur = self;
165-
loop {
166-
let borrowed = &mut *cur;
167-
cur = match *borrowed {
168-
MutCons(ref mut hd, tl) => {
169-
if !f(hd) {
170-
return false;
171-
}
172-
tl
173-
}
174-
MutNil => break
175-
}
176-
}
177-
return true;
178-
}
179-
}
180-
181154
#[cfg(test)]
182155
mod tests {
183156
use list::*;

0 commit comments

Comments
 (0)