You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ibraheemdev! First of all, thanks for your work!
I'm trying to match a mix of dynamic and static routes, which have overlapping parts. But not all the cases are matching.
I guess this is better explained with the following code snippet.
#[cfg(test)]
mod tests {
use matchit::Node;
#[test]
fn test_routes() {
let mut matcher = Node::new();
matcher.insert("/:object/:id", "object with id").unwrap();
matcher.insert("/secret/:id/path", "secret with id and path").unwrap();
let matched = matcher.at("/secret/978/path").unwrap();
assert_eq!(matched.params.get("id"), Some("978"));
let matched = matcher.at("/something/978").unwrap();
assert_eq!(matched.params.get("id"), Some("978"));
assert_eq!(matched.params.get("object"), Some("something"));
let _ = matcher.at("/secret/978").unwrap(); // panics
}
}
It it expected behaviour?
The text was updated successfully, but these errors were encountered:
Hi @ibraheemdev! First of all, thanks for your work!
I'm trying to match a mix of dynamic and static routes, which have overlapping parts. But not all the cases are matching.
I guess this is better explained with the following code snippet.
It it expected behaviour?
The text was updated successfully, but these errors were encountered: