-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative literal path segments for route definitions (#2815) #2920
Conversation
@@ -458,6 +530,7 @@ object PathCodec { | |||
private[http] sealed trait Opt | |||
private[http] object Opt { | |||
final case class Match(value: String) extends Opt | |||
final case class MatchAny(values: Set[String]) extends Opt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to use a set here. We can do even better than that by producing a finite state machine that produces true for a match, and false otherwise (due to the char-by-char nature of testing for string equality). But, separate issue and PR. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean some structure, where we have like n
states, where n
is max length of the alternatives and there is a way to progress to the next state with the right char, true if the string ends or false for any other char, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just one relatively minor change!
f9fc488
to
f7c392e
Compare
f7c392e
to
a44bd4d
Compare
fixes #2815
/claim #2815