construct_runtime!: Support parsing struct Runtime (#11932)

* construct_runtime!: Support parsing `struct Runtime`

* FMT
This commit is contained in:
Bastian Köcher authored and GitHub committed 2022-07-29 09:22:49 +00:00
1 parent c4b607d4c9
commit 4b3aced87e
3 files changed
+12 -4

No files matched your search

@@ -73,7 +73,14 @@ pub struct ExplicitRuntimeDeclaration {
impl Parse for RuntimeDeclaration {
fn parse(input: ParseStream) -> Result<Self> {
input.parse::<Token![pub]>()?;
input.parse::<Token![enum]>()?;
// Support either `enum` or `struct`.
if input.peek(Token![struct]) {
input.parse::<Token![struct]>()?;
} else {
input.parse::<Token![enum]>()?;
}
let name = input.parse::<syn::Ident>()?;
let where_section = input.parse()?;
let pallets =