File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,6 @@ pub enum List<T> {
19
19
Nil ,
20
20
}
21
21
22
- #[ deriving( Eq ) ]
23
- #[ allow( missing_doc) ]
24
- pub enum MutList < T > {
25
- MutCons ( T , @mut MutList < T > ) ,
26
- MutNil ,
27
- }
28
-
29
22
/// Create a list from a vector
30
23
pub fn from_vec < T : Clone + ' static > ( v : & [ T ] ) -> @List < T > {
31
24
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 {
158
151
}
159
152
}
160
153
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
-
181
154
#[ cfg( test) ]
182
155
mod tests {
183
156
use list:: * ;
You can’t perform that action at this time.
0 commit comments