mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Fix multiple field enum tokens (#1988)
A small change so that enums with multiple fields are comma seperated.
This commit is contained in:
parent
47550292d5
commit
5ea6aec804
@ -119,7 +119,7 @@ impl Routable {
|
||||
//named fields have idents
|
||||
it.ident.as_ref().unwrap()
|
||||
});
|
||||
quote! { Self::#ident { #(#fields: params.get(stringify!(#fields))?.parse().ok()?)*, } }
|
||||
quote! { Self::#ident { #(#fields: params.get(stringify!(#fields))?.parse().ok()?,)* } }
|
||||
}
|
||||
Fields::Unnamed(_) => unreachable!(), // already checked
|
||||
};
|
||||
|
||||
@ -6,6 +6,8 @@ enum Routes {
|
||||
One,
|
||||
#[at("/two/:id")]
|
||||
Two { id: u32 },
|
||||
#[at("/:a/:b")]
|
||||
Three { a: u32, b: u32 },
|
||||
#[at("/404")]
|
||||
#[not_found]
|
||||
NotFound,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user