File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -250,13 +250,13 @@ impl Context {
250
250
println ! ( "Directory listing of {:?}" , path) ;
251
251
let dir = self . resolve_existing_directory ( path) ?;
252
252
// tree_dir will close this directory, always
253
- self . tree_dir ( dir)
253
+ Self :: tree_dir ( dir)
254
254
}
255
255
256
256
/// Print a recursive directory listing for the given open directory.
257
257
///
258
258
/// Will close the given directory.
259
- fn tree_dir < ' a > ( & ' a self , dir : Directory < ' a > ) -> Result < ( ) , Error > {
259
+ fn tree_dir ( dir : Directory ) -> Result < ( ) , Error > {
260
260
let mut children = Vec :: new ( ) ;
261
261
dir. iterate_dir ( |entry| {
262
262
println ! (
@@ -272,17 +272,9 @@ impl Context {
272
272
} ) ?;
273
273
for child in children {
274
274
println ! ( "Entering {}" , child) ;
275
- let child_dir = match dir. open_dir ( & child) {
276
- Ok ( child_dir) => child_dir,
277
- Err ( e) => {
278
- return Err ( e) ;
279
- }
280
- } ;
281
- let result = self . tree_dir ( child_dir) ;
275
+ let child_dir = dir. open_dir ( & child) ?;
276
+ Self :: tree_dir ( child_dir) ?;
282
277
println ! ( "Returning from {}" , child) ;
283
- if let Err ( e) = result {
284
- return Err ( e) ;
285
- }
286
278
}
287
279
Ok ( ( ) )
288
280
}
You can’t perform that action at this time.
0 commit comments