allow extra fields in the enum not from the route

This commit is contained in:
Evan Almloff committed 2023-05-23 13:57:50 -05:00
1 parent 46017d5b7e
commit 1f68399e7b
5 files changed
+43 -14

No files matched your search

+2 -1
View File
@@ -161,6 +161,7 @@ impl RouteEnum {
quote! {
impl std::fmt::Display for #name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
#[allow(unused)]
match self {
#(#display_match)*
}
@@ -177,7 +178,7 @@ impl RouteEnum {
let error_name = format_ident!("{}MatchError", self.name);
let tokens = tree.roots.iter().map(|&id| {
let route = tree.get(id).unwrap();
route.to_tokens(&tree, self.name.clone(), error_name.clone())
route.to_tokens(&self.nests, &tree, self.name.clone(), error_name.clone())
});
quote! {