construct_runtime!: Support parsing struct Runtime (#11932)

* construct_runtime!: Support parsing `struct Runtime`

* FMT
This commit is contained in:
Bastian Köcher
2022-07-29 10:22:49 +01:00
committed by GitHub
parent c4b607d4c9
commit 4b3aced87e
3 changed files with 12 additions and 4 deletions
@@ -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 =