-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
- Pass: Inserting
"{foo}/"then"foo/". - Panic: Inserting
"foo/"then"{foo}/".
Reproduction
#[test]
fn local_test() {
InsertTest(vec![("{foo}/", Ok(())), ("foo/", Ok(()))]).run(); // ok
InsertTest(vec![("foo/", Ok(())), ("{foo}/", Ok(()))]).run() // panic
}Investigation
// tree.rs
if common_remaining[common_prefix - 1] != b'/'
&& node.suffix_wild_child_in_segment()
{
return Err(InsertError::conflict(&route, remaining, node));
}common_prefix is 0 when routes do not have a leading slash,
Question
With a leading slash, this will not be a problem.
But i found some routes in test do not have the leading slash.
Is matchit intended to support routes without the leading slash?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working