Merge branch 'DioxusLabs:master' into dedup-history

This commit is contained in:
ealmloff 2023-08-01 12:32:46 -05:00 committed by GitHub
commit 0c093964bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -485,7 +485,13 @@ impl RouteEnum {
let mut segments = route.split('/');
// skip the first empty segment
if s.starts_with('/') {
segments.next();
let _ = segments.next();
}
else {
// if this route does not start with a slash, it is not a valid route
return Err(dioxus_router::routable::RouteParseError {
attempted_routes: Vec::new(),
});
}
let mut errors = Vec::new();

View file

@ -367,7 +367,7 @@ impl<'a> RouteTreeSegmentData<'a> {
let child_name = &child.ident;
quote! {
let mut trailing = String::new();
let mut trailing = String::from("/");
for seg in segments.clone() {
trailing += seg;
trailing += "/";