BurntSushi / ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore
The Unlicense
48.33k stars 1.98k forks source link

ignore crate: DirEntry is not Clone #891

Closed stevedonovan closed 6 years ago

stevedonovan commented 6 years ago

Not a ripgrep issue, so excuse me ignoring the standard boilerplate.

ignore::walk::DirEntry cannot be cloned, which is an issue if I want to use it in findr. findr uses the most excellent embedded mini-scripting language Rhai, and Rust structs must be clonable to inter-operate with it.

I've been using a combination of walkdir (which does provide a clonable DirEntry) and the gitignore crate. In effect, I have to reproduce a (subset) of ignore functionality in findr - it would be rather nice to offload that to a crate that already knows about directory iteration that can ignore non-essential files.

Edit: Had a look - not so trivial, since Error must be Clone and std::io::Error is not....

BurntSushi commented 6 years ago

This is now on crates.io in ignore 0.4.2.

stevedonovan commented 6 years ago

Cool, thanks!