File tree Expand file tree Collapse file tree 3 files changed +2
-8
lines changed Expand file tree Collapse file tree 3 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ extension Regex {
1616 public init < Content: RegexComponent > (
1717 @RegexComponentBuilder _ content: ( ) -> Content
1818 ) where Content. Output == Output {
19- self . init ( content ( ) )
19+ self = content ( ) . regex
2020 }
2121}
2222
Original file line number Diff line number Diff line change @@ -81,12 +81,6 @@ public struct Regex<Output>: RegexComponent {
8181 self . init ( ast: try ! parseWithDelimiters ( pattern) )
8282 }
8383
84- public init < Content: RegexComponent > (
85- _ content: Content
86- ) where Content. Output == Output {
87- self = content. regex
88- }
89-
9084 public var regex : Regex < Output > {
9185 self
9286 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class RegexDSLTests: XCTestCase {
2222 line: UInt = #line,
2323 @RegexComponentBuilder _ content: ( ) -> Content
2424 ) throws {
25- let regex = Regex ( content ( ) )
25+ let regex = content ( )
2626 for (input, maybeExpectedCaptures) in tests {
2727 let maybeMatch = input. match ( regex)
2828 if let expectedCaptures = maybeExpectedCaptures {
You can’t perform that action at this time.
0 commit comments