Skip to content

Commit ff86972

Browse files
committed
Simplify source_builder.rs
1 parent 57b8e89 commit ff86972

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

generate/src/source_builder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ impl Module {
160160
)?;
161161
if let Some(fns) = self.fns.remove(qualified_trait_wrapper) {
162162
for Fn { attrs, sig, body } in fns {
163-
let attrs = remove_common_attrs(attrs, &common_attrs);
164-
writeln!(file, "{}{sig} {{{body}}}", join_attrs(&attrs))?;
163+
let attrs = join_attrs(&remove_common_attrs(attrs, &common_attrs));
164+
writeln!(file, "{attrs}{sig} {{{body}}}")?;
165165
}
166166
}
167167
writeln!(
@@ -216,8 +216,8 @@ impl Module {
216216
body: _,
217217
} in fns
218218
{
219-
let attrs = remove_common_attrs(attrs.clone(), &common_attrs);
220-
writeln!(file, "{}{sig};", join_attrs(&attrs))?;
219+
let attrs = join_attrs(&remove_common_attrs(attrs.clone(), &common_attrs));
220+
writeln!(file, "{attrs}{sig};")?;
221221
}
222222
}
223223
writeln!(
@@ -230,8 +230,8 @@ impl Module {
230230
)?;
231231
if let Some(fns) = self.fns.remove(qualified_struct_wrapper) {
232232
for Fn { attrs, sig, body } in fns {
233-
let attrs = remove_common_attrs(attrs, &common_attrs);
234-
writeln!(file, "{}{sig} {{{body}}}", join_attrs(&attrs))?;
233+
let attrs = join_attrs(&remove_common_attrs(attrs, &common_attrs));
234+
writeln!(file, "{attrs}{sig} {{{body}}}")?;
235235
}
236236
}
237237
writeln!(file, "}}")?;
@@ -263,8 +263,8 @@ impl Module {
263263
)?;
264264
}
265265
for Fn { attrs, sig, body } in fns {
266-
let attrs = remove_common_attrs(attrs.clone(), &common_attrs);
267-
writeln!(file, "{}{sig} {{{body}}}", join_attrs(&attrs))?;
266+
let attrs = join_attrs(&remove_common_attrs(attrs.clone(), &common_attrs));
267+
writeln!(file, "{attrs}{sig} {{{body}}}")?;
268268
}
269269
if !qualified_struct_wrapper.is_empty() {
270270
writeln!(file, "}}")?;

0 commit comments

Comments
 (0)