mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Format components dom_struct, domobject_derive and embedder_traits #21373
This commit is contained in:
parent
aa61200eca
commit
d76ddabba4
4 changed files with 47 additions and 19 deletions
|
@ -25,7 +25,6 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||
// Work around https://github.com/rust-lang/rust/issues/46489
|
||||
let attributes: TokenStream = attributes.to_string().parse().unwrap();
|
||||
|
||||
|
||||
let output: TokenStream = attributes.into_iter().chain(input.into_iter()).collect();
|
||||
|
||||
let item: Item = syn::parse(output).unwrap();
|
||||
|
@ -36,7 +35,11 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||
return quote!(#s2).into();
|
||||
}
|
||||
if let Fields::Named(ref f) = s.fields {
|
||||
let f = f.named.first().expect("Must have at least one field").into_value();
|
||||
let f = f
|
||||
.named
|
||||
.first()
|
||||
.expect("Must have at least one field")
|
||||
.into_value();
|
||||
let ident = f.ident.as_ref().expect("Must have named fields");
|
||||
let name = &s.ident;
|
||||
let ty = &f.ty;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue