diff options
author | Christian Vallentin <mail@vallentin.dev> | 2023-08-29 04:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 22:55:19 -0400 |
commit | 6cd947963420360d8e4fe7f9eff93f4636d037a1 (patch) | |
tree | ef877bcb654cd73551e0422bfa596207a77cdc3f /crates/ignore | |
parent | 3bfa125b2ea8175947360322f1429a0205be6c76 (diff) |
ignore: implement FusedIterator for Walk
PR #2567
Diffstat (limited to 'crates/ignore')
-rw-r--r-- | crates/ignore/src/walk.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ignore/src/walk.rs b/crates/ignore/src/walk.rs index 1f7d06e5..734b8766 100644 --- a/crates/ignore/src/walk.rs +++ b/crates/ignore/src/walk.rs @@ -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}; @@ -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 |