-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Description
Please tick this box to confirm you have reviewed the above.
- I have a different issue.
What version of ripgrep are you using?
ignore: 0.4.25
rust version: 1.94.0 (4a4ef493e 2026-03-02) (via rustc --version)
How did you install ripgrep?
cargo add ignore
What operating system are you using ripgrep on?
Windows11
Describe your bug.
I want to use the ignore crate to retrieve information about files in a specified directory while excluding the directory itself. To achieve this, I set both min_depth and max_depth to Some(1). However, a panic occurred when accessing the root directory.
What are the steps to reproduce the behavior?
On Windows11
mod test {
use ignore::WalkBuilder;
#[test]
fn test_ignore_current_path() {
let walk = WalkBuilder::new("C:\\").min_depth(Some(1)).max_depth(Some(1)).build();
walk.into_iter().for_each(|entry| {
println!("{:?}", entry);
});
}
}On ArchLinux(WSL)
use ignore::WalkBuilder;
fn main() {
let walk = WalkBuilder::new("/")
.min_depth(Some(1))
.max_depth(Some(1))
.build();
walk.into_iter().for_each(|entry| {
println!("{:?}", entry);
});
}What is the actual behavior?
Here is the panic infomation when run on ArchLinux(WSL)
What is the expected behavior?
I haven't looked at the specific usage of self.ig; maybe it needs to be changed to the type Option?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels