[PR #192] [CLOSED] Add support for specifying multiple filters #351

Closed
opened 2026-06-08 11:27:25 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/192
Author: @rtpg
Created: 10/23/2021
Status: Closed

Base: masterHead: multiple-filters


📝 Commits (1)

  • 50286d6 Add 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/None approach.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/192 **Author:** [@rtpg](https://github.com/rtpg) **Created:** 10/23/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `multiple-filters` --- ### 📝 Commits (1) - [`50286d6`](https://github.com/bootandy/dust/commit/50286d6f5802a2d7d1dc6dcf17379f619c96ef2b) Add support for specifying multiple filters ### 📊 Changes **5 files changed** (+80 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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`/`None` approach. 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:27:25 +03:00
zhus closed this issue 2026-06-08 11:27:25 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#351