mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
chore: Upgrade matchit to 0.8 (#2645)
This commit is contained in:
@@ -383,8 +383,12 @@ fn parse_path(path: &LitStr) -> syn::Result<Vec<Segment>> {
|
||||
.split('/')
|
||||
.map(|segment| {
|
||||
if let Some(capture) = segment
|
||||
.strip_prefix(':')
|
||||
.or_else(|| segment.strip_prefix('*'))
|
||||
.strip_prefix('{')
|
||||
.and_then(|segment| segment.strip_suffix('}'))
|
||||
.and_then(|segment| {
|
||||
(!segment.starts_with('{') && !segment.ends_with('}')).then_some(segment)
|
||||
})
|
||||
.map(|capture| capture.strip_prefix('*').unwrap_or(capture))
|
||||
{
|
||||
Ok(Segment::Capture(capture.to_owned(), path.span()))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user