Skip to content

Fix/grep dedup - #7

Merged
devfire merged 3 commits into
mainfrom
fix/grep-dedup
Jun 20, 2026
Merged

Fix/grep dedup#7
devfire merged 3 commits into
mainfrom
fix/grep-dedup

Conversation

@devfire

@devfire devfire commented Jun 20, 2026

Copy link
Copy Markdown
Owner

No description provided.

devfire added 3 commits June 20, 2026 14:06
Extract shared error-tracking into an ErrorState struct with
record_entry_error(), record_search_error(), and into_metadata() methods.

Unify grep_content and grep_files into a single grep_streamed() function
parameterized by a StreamMode enum (Content | FilesWithMatches), since
both share the exact same walker + channel + early-quit structure.

Extract build_matcher() and build_searcher() helpers that encapsulate
the mode-specific searcher configuration (line numbers, context).

Net result: -51 lines, elimination of ~30 redundant Arc::clone calls,
and single points of change for entry validation, error recording, and
response assembly logic.
@devfire devfire self-assigned this Jun 20, 2026
@devfire
devfire merged commit d2bc82c into main Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant