From 1cd092db63e15d5a06574999cba0d10c81e7fbd5 Mon Sep 17 00:00:00 2001 From: kingdido999 Date: Mon, 10 Sep 2018 11:03:38 +0800 Subject: [PATCH] Format jstraceable_derive #21373 --- components/jstraceable_derive/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/jstraceable_derive/lib.rs b/components/jstraceable_derive/lib.rs index a780a6e2167..ac793f4d85a 100644 --- a/components/jstraceable_derive/lib.rs +++ b/components/jstraceable_derive/lib.rs @@ -3,15 +3,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ extern crate quote; -#[macro_use] extern crate syn; -#[macro_use] extern crate synstructure; +#[macro_use] +extern crate syn; +#[macro_use] +extern crate synstructure; decl_derive!([JSTraceable] => js_traceable_derive); fn js_traceable_derive(s: synstructure::Structure) -> quote::Tokens { - let match_body = s.each(|binding| { - Some(quote!(#binding.trace(tracer);)) - }); + let match_body = s.each(|binding| Some(quote!(#binding.trace(tracer);))); let ast = s.ast(); let name = ast.ident; @@ -19,7 +19,9 @@ fn js_traceable_derive(s: synstructure::Structure) -> quote::Tokens { let mut where_clause = where_clause.unwrap_or(&parse_quote!(where)).clone(); for param in ast.generics.type_params() { let ident = param.ident; - where_clause.predicates.push(parse_quote!(#ident: ::dom::bindings::trace::JSTraceable)) + where_clause + .predicates + .push(parse_quote!(#ident: ::dom::bindings::trace::JSTraceable)) } let tokens = quote! {