Repository navigation
feat(router)!: Adopt matchit 0.9 route syntax and prepare Windmark 0.10.0 - #9
Merged
Merged
Conversation
Raises the floors for async-trait, futures-util, log, openssl, quote, and tokio, and keeps the consumer fixture's tokio and async-trait floors in step.
Routes now capture segments with {name} and the remaining path with {*name}. Matchit 0.9 reads the former :name and *name forms as literal text, so mount rejects segments that start with them rather than registering routes that never match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windmark's router used matchit 0.7.3, the last release before matchit changed its route syntax. This PR moves the router to matchit 0.9 and its braced route parameters.
mountnow panics on the old syntax, which would otherwise mount without error and never match. The PR also updates the remaining dependencies and bumps Windmark to 0.10.0 and Rossweisse to 0.0.5.Changes
{name}and the remaining path with a trailing{*name}. A parameter can now have a static prefix or suffix within its segment, such as/img-{id}.png.mountpanic on a route with a segment that starts with:or*. The panic message shows the braced form. Matchit 0.9 treats these segments as literal text, so/users/:idwould match only the path/users/:id.{{and}}as literal braces.Cargo.lockandtests/consumer/Cargo.lockso CI and local builds resolve the same dependency versions. Cargo ignores a dependency's lockfile, so applications using Windmark still resolve versions from itsCargo.toml.Compatibility
Route parameters must use the braced syntax:
/users/:name/users/{name}/files/*path/files/{*path}/files/Prefix:Name/files/Prefix{Name}mountpanics on a route with a segment that starts with:or*, and the message shows the replacement.Windmark can't tell a parameter in the middle of a segment, such as
Prefix:Name, from a literal colon, such as/time/12:30.mountaccepts both as static text, so rewrite these parameters by hand.Write literal braces in routes as
{{and}}.