Move off of RegexBuilder for URL.Template#1273
Conversation
|
@swift-ci please test |
| } | ||
| } | ||
| } | ||
| self.operatorRegex = try! Regex(#"([\+#.\/;\?&])?"#) |
There was a problem hiding this comment.
Do you know if it makes a difference whether you create a Regex this way or the other one that specifies the output type?
init(
_ pattern: String,
as outputType: Output.Type = Output.self
) throwsFor example would it help the performance since we can bypass parsing the result from AnyOutputRegex?
There was a problem hiding this comment.
I have no idea if that makes any difference. Happy to change it, if that helps. These are only every created once, though.
There was a problem hiding this comment.
I'm ok with this as-is for now. We can always come back if we find this useful later.
|
@danieleggert Can you rebase to resolve the merge conflict? |
There was a problem hiding this comment.
I don't think this annotation is needed since URL.Template.Element is an internal type, but otherwise LGTM!
|
@swift-ci please test |
| } | ||
| } | ||
| } | ||
| self.operatorRegex = try! Regex(#"([\+#.\/;\?&])?"#) |
There was a problem hiding this comment.
I'm ok with this as-is for now. We can always come back if we find this useful later.
This fixes #1269
This uses
try! Regex("…")instead ofRegexBuilderto create regular expressions used by the URL Template implementation.