Skip to content

Conversation

evilpie
Copy link
Contributor

@evilpie evilpie commented Sep 17, 2025

This now compiles and matches the code at

rust-urlpattern/src/lib.rs

Lines 266 to 283 in 4b585ac

/// ```
/// use urlpattern::UrlPattern;
/// use urlpattern::UrlPatternInit;
/// use urlpattern::UrlPatternMatchInput;
///
///# fn main() {
/// // Create the UrlPattern to match against.
/// let init = UrlPatternInit {
/// pathname: Some("/users/:id".to_owned()),
/// ..Default::default()
/// };
/// let pattern = <UrlPattern>::parse(init, Default::default()).unwrap();
///
/// // Match the pattern against a URL.
/// let url = "https://example.com/users/123".parse().unwrap();
/// let result = pattern.exec(UrlPatternMatchInput::Url(url)).unwrap().unwrap();
/// assert_eq!(result.pathname.groups.get("id").unwrap().as_ref().unwrap(), "123");
///# }
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant