refactor: introduce SequenceExpr::word_seq()#3659
Merged
elijah-potter merged 4 commits intoJun 15, 2026
Merged
Conversation
elijah-potter
requested changes
Jun 15, 2026
elijah-potter
left a comment
Collaborator
There was a problem hiding this comment.
Looks mostly good. Just one nit.
|
|
||
| /// Match a series of words separated by whitespace. | ||
| pub fn then_word_seq(self, words: &'static [&'static str]) -> Self { | ||
| debug_assert!(!words.is_empty(), "words must not be empty"); |
Collaborator
There was a problem hiding this comment.
I feel like it should be OK for it to be empty. People may insert an empty array for debugging purposes.
elijah-potter
approved these changes
Jun 15, 2026
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.
Issues
N/A
Description
I thought there was a pattern of linters using sequences of words separated by whitespace and realized a new ctor and builder on
SequenceExprcould take an array of just the words and add in the whitespace elements.It turned out that only one linter used more than two words but there were also a few uses of
fixed_phrasethat are probably more efficient asword_seq.Demo
How Has This Been Tested?
cargo testAI Disclosure
Checklist