File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -147,18 +147,17 @@ fn compose_pattern_for_nfa(
147147 let mut public_count = 0 ;
148148
149149 for part in & config. parts {
150- let part_pattern = match part {
150+ match part {
151151 RegexPart :: Pattern ( p) => {
152152 // Wrap in non-capturing group
153- format ! ( "(?:{})" , p )
153+ pattern . push_str ( p ) ;
154154 } ,
155155 RegexPart :: PublicPattern ( ( p, _max_bytes) ) => {
156156 public_count += 1 ;
157157 // Wrap in capturing group
158- format ! ( "({})" , p)
158+ pattern . push_str ( & format ! ( "({})" , p) . as_str ( ) ) ;
159159 }
160160 } ;
161- pattern. push_str ( & part_pattern) ;
162161 }
163162
164163 // Verify we got the expected number of public parts
@@ -186,19 +185,18 @@ fn compose_pattern_standalone(
186185 let mut current_group = 1 ; // Group 0 is always the full match
187186
188187 for part in & config. parts {
189- let part_pattern = match part {
188+ match part {
190189 RegexPart :: Pattern ( p) => {
191190 // Wrap in non-capturing group
192- format ! ( "(?:{})" , p )
191+ pattern . push_str ( p ) ;
193192 } ,
194193 RegexPart :: PublicPattern ( ( p, _max_bytes) ) => {
195194 // Wrap in capturing group
196195 public_group_indices. push ( current_group) ;
197196 current_group += 1 ;
198- format ! ( "({})" , p)
197+ pattern . push_str ( & format ! ( "({})" , p) . as_str ( ) ) ;
199198 }
200199 } ;
201- pattern. push_str ( & part_pattern) ;
202200 }
203201
204202 if pattern. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments