@@ -140,11 +140,11 @@ mod tests {
140
140
assert_eq ! ( * expected, fake. insert_v0( bytes) . to_string( ) ) ;
141
141
}
142
142
143
- let mut walk = Some ( Walker :: new (
143
+ let mut walker = Walker :: new (
144
144
// note: this matches the `symlinks_in_trees` root cid (the last cid produced)
145
145
Cid :: try_from ( tree_blocks[ 0 ] . 0 ) . unwrap ( ) ,
146
146
String :: default ( ) ,
147
- ) ) ;
147
+ ) ;
148
148
149
149
#[ derive( Debug , PartialEq , Eq ) ]
150
150
enum Entry {
@@ -155,25 +155,24 @@ mod tests {
155
155
156
156
let mut actual = Vec :: new ( ) ;
157
157
158
- while let Some ( walker) = walk {
158
+ while walker. should_continue ( ) {
159
159
let ( next, _) = walker. pending_links ( ) ;
160
160
let next = fake. get_by_cid ( next) ;
161
161
162
- walk = match walker. continue_walk ( next, & mut None ) . unwrap ( ) {
163
- ContinuedWalk :: File ( _, it) => {
164
- actual. push ( Entry :: File ( it. as_entry ( ) . path ( ) . into ( ) ) ) ;
165
- it. into_inner ( )
162
+ match walker. next ( next, & mut None ) . unwrap ( ) {
163
+ ContinuedWalk :: File ( _fs, _cid, path, _metadata, _total_size) => {
164
+ actual. push ( Entry :: File ( path. into ( ) ) ) ;
166
165
}
167
- ContinuedWalk :: Directory ( it ) => {
168
- actual . push ( Entry :: Dir ( it . as_entry ( ) . path ( ) . into ( ) ) ) ;
169
- it . into_inner ( )
166
+ ContinuedWalk :: RootDirectory ( _cid , path , _metadata )
167
+ | ContinuedWalk :: Directory ( _cid , path, _metadata ) => {
168
+ actual . push ( Entry :: Dir ( path . into ( ) ) ) ;
170
169
}
171
- ContinuedWalk :: Symlink ( link_name, it) => {
170
+ ContinuedWalk :: Bucket ( ..) => { /* ignore */ }
171
+ ContinuedWalk :: Symlink ( link_name, _cid, path, _metadata) => {
172
172
actual. push ( Entry :: Symlink (
173
- it . as_entry ( ) . path ( ) . into ( ) ,
173
+ path. into ( ) ,
174
174
std:: str:: from_utf8 ( link_name) . unwrap ( ) . to_owned ( ) ,
175
175
) ) ;
176
- it. into_inner ( )
177
176
}
178
177
} ;
179
178
}
0 commit comments