BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.21k stars 106 forks source link

`filter_entry().filter_entry()` is broken #192

Open obsgolem opened 7 months ago

obsgolem commented 7 months ago

FilterEntry::filter_entry is parameterized on the global P instead of a new, local P. This means that you can't call filter_entry twice with two different functions.

EDIT: Minimal repro:

use walkdir::WalkDir;

fn main() {
    let temp = WalkDir::new(".")
        .into_iter()
        .filter_entry(|x| true)
        .filter_entry(|x| true);
}

Playground link

Expected: compiles Actual: doesn't

BurntSushi commented 7 months ago

Please provide a code example. Provide enough instructions and data for me to be able to reproduce the problem you're seeing. Please also state what problem you're trying to solve. Include any relevant input data. Please include actual output and expected output.

obsgolem commented 6 months ago

Updated, sorry.