mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[PR #192] [CLOSED] Add support for specifying multiple filters #351
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/bootandy/dust/pull/192
Author: @rtpg
Created: 10/23/2021
Status: ❌ Closed
Base:
master← Head:multiple-filters📝 Commits (1)
50286d6Add support for specifying multiple filters📊 Changes
5 files changed (+80 additions, -43 deletions)
View changed files
📝
src/dir_walker.rs(+15 -14)📝
src/main.rs(+20 -14)📝
src/node.rs(+10 -7)📝
src/utils.rs(+21 -8)📝
tests/test_flags.rs(+14 -0)📄 Description
The current code would only use the first provided filter/exclusion filter.
For filters, it will only return paths that match all the filters, and for exclusions it will only return paths that match none of the filters.
This is a proposed fix for #188. I tried to keep similar performance characteristics when only one element is provided, by matching up the regexes via their length to mirror the
Some/Noneapproach.Here the idea is to hold onto the filters as a list and then check for them. I think there's an even more performant strategy of basically building a single regex out of all of these, but I'm not super confident in my regex-building skills to do the escaping right.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.