Format codegen with rustfmt 0.9.0
diff --git a/codegen/src/main.rs b/codegen/src/main.rs
index 89eec81..ed6bfc8 100644
--- a/codegen/src/main.rs
+++ b/codegen/src/main.rs
@@ -623,10 +623,7 @@
ty = ty,
name = name.tokens(),
),
- Visit => format!(
- "tokens_helper(_visitor, &({name}).0)",
- name = name.tokens(),
- ),
+ Visit => format!("tokens_helper(_visitor, &({name}).0)", name = name.tokens(),),
VisitMut => format!(
"tokens_helper(_visitor, &mut ({name}).0)",
name = name.tokens(),
@@ -754,8 +751,7 @@
Ident::new(&name, Span::call_site()).to_tokens(&mut tokens);
(el, tokens)
- })
- .collect();
+ }).collect();
state.visit_impl.push_str(") => {\n");
state.visit_mut_impl.push_str(") => {\n");
@@ -831,8 +827,7 @@
.map(|el| {
let id = el.ident.clone();
(el, quote!(_i.#id))
- })
- .collect()
+ }).collect()
}
Fields::Unnamed(ref fields) => {
state
@@ -845,13 +840,14 @@
.map(|(idx, el)| {
let id = Index::from(idx);
(el, quote!(_i.#id))
- })
- .collect()
+ }).collect()
}
Fields::Unit => {
if s.ast.ident == "Ident" {
state.fold_impl.push_str(" let mut _i = _i;\n");
- state.fold_impl.push_str(" let span = _visitor.fold_span(_i.span());\n");
+ state
+ .fold_impl
+ .push_str(" let span = _visitor.fold_span(_i.span());\n");
state.fold_impl.push_str(" _i.set_span(span);\n");
}
state.fold_impl.push_str(" _i\n");
@@ -967,8 +963,10 @@
}
";
- write_file(FOLD_SRC, format!(
- "\
+ write_file(
+ FOLD_SRC,
+ format!(
+ "\
// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
// Unreachable code is generated sometimes without the full feature.
@@ -1021,13 +1019,16 @@
{fold_impl}
",
- full_macro = full_macro,
- fold_trait = state.fold_trait,
- fold_impl = state.fold_impl
- ));
+ full_macro = full_macro,
+ fold_trait = state.fold_trait,
+ fold_impl = state.fold_impl
+ ),
+ );
- write_file(VISIT_SRC, format!(
- "\
+ write_file(
+ VISIT_SRC,
+ format!(
+ "\
// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
#![cfg_attr(feature = \"cargo-clippy\", allow(match_same_arms))]
@@ -1054,13 +1055,16 @@
{visit_impl}
",
- full_macro = full_macro,
- visit_trait = state.visit_trait,
- visit_impl = state.visit_impl
- ));
+ full_macro = full_macro,
+ visit_trait = state.visit_trait,
+ visit_impl = state.visit_impl
+ ),
+ );
- write_file(VISIT_MUT_SRC, format!(
- "\
+ write_file(
+ VISIT_MUT_SRC,
+ format!(
+ "\
// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
#![cfg_attr(feature = \"cargo-clippy\", allow(match_same_arms))]
@@ -1088,8 +1092,9 @@
{visit_mut_impl}
",
- full_macro = full_macro,
- visit_mut_trait = state.visit_mut_trait,
- visit_mut_impl = state.visit_mut_impl
- ));
+ full_macro = full_macro,
+ visit_mut_trait = state.visit_mut_trait,
+ visit_mut_impl = state.visit_mut_impl
+ ),
+ );
}