Skip to content

Commit dabf61c

Browse files
committed
expr: Refactor caret options into one pattern
1 parent ef744c5 commit dabf61c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/uu/expr/src/syntax_tree.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ impl StringOp {
173173
match curr {
174174
'^' => match (prev, prev_is_escaped) {
175175
// Start of a capturing group
176-
('(', true) => re_string.push(curr),
176+
('(', true)
177177
// Start of an alternative pattern
178-
('|', true) => re_string.push(curr),
178+
| ('|', true)
179179
// Character class negation "[^a]"
180-
('[', false) => re_string.push(curr),
180+
| ('[', false)
181181
// Explicitly escaped caret
182-
('\\', false) => re_string.push(curr),
182+
| ('\\', false) => re_string.push(curr),
183183
_ => re_string.push_str(r"\^"),
184184
},
185185
'$' => {

0 commit comments

Comments
 (0)