1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-01-03 05:10:12 +02:00

ignore: implement FusedIterator for Walk

PR #2567
This commit is contained in:
Christian Vallentin 2023-08-29 04:55:19 +02:00 committed by GitHub
parent 3bfa125b2e
commit 6cd9479634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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