Skip to content

Commit

Permalink
ignore: implement FusedIterator for Walk
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin authored Aug 29, 2023
1 parent 3bfa125 commit 6cd9479
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ignore/src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ffi::OsStr;
use std::fmt;
use std::fs::{self, FileType, Metadata};
use std::io;
use std::iter::FusedIterator;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
Expand Down Expand Up @@ -1040,6 +1041,8 @@ impl Iterator for Walk {
}
}

impl FusedIterator for Walk {}

/// WalkEventIter transforms a WalkDir iterator into an iterator that more
/// accurately describes the directory tree. Namely, it emits events that are
/// one of three types: directory, file or "exit." An "exit" event means that
Expand Down

0 comments on commit 6cd9479

Please sign in to comment.