Update WatchFilter API#3
Merged
Merged
Conversation
2 tasks
kevinyang372
approved these changes
May 21, 2026
| )?; | ||
| watch_self = false; | ||
| .into_iter(); | ||
| while let Some(entry_result) = iter.next() { |
Member
There was a problem hiding this comment.
ooc why do we need to rewrite the for iterator into while let?
My understanding is we should just change should_watch in the original filter to should_watch_directory right?
Author
There was a problem hiding this comment.
iiuc the previous filter_map and filter would evaluate the entry/directory after it's already been explored, whereas WalkDir::skip_current_dir ensures that we're skipping entries before exploring them
I believe we can similarly use WalkDir::filter_entry to be slightly more ergonomic but I don't have a strong opinion
| } | ||
| } | ||
|
|
||
| /// return `DirEntry` when it is a directory |
Member
There was a problem hiding this comment.
See above but I think we should be able to keep the original logic here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
WatchFilterAPI to support more granular filter fns -should_emit_eventandshould_watch_directoryOz plan: https://staging.warp.dev/drive/notebook/Linux-inotify-dual-predicate-watch-filter-Warp-caller-updates-5HQUBSdF5ZqO5e8GxJmuAe
Testing