chore: Upgrade matchit to 0.8 (#2645)

This commit is contained in:
David Mládek
2024-10-03 15:46:58 +00:00
committed by GitHub
parent 5db62e8452
commit 6318b57fda
46 changed files with 414 additions and 208 deletions
+6 -2
View File
@@ -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 {