Skip to content

Commit

Permalink
refactor: destructure WalkNodesOutput extend
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Jan 14, 2025
1 parent f5045fa commit 9d71054
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions examples/html-to-string-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ impl<'a> WalkNodes<'a> {

impl WalkNodesOutput {
fn extend(&mut self, other: WalkNodesOutput) {
self.static_format.push_str(&other.static_format);
self.values.extend(other.values);
self.diagnostics.extend(other.diagnostics);
self.collected_elements.extend(other.collected_elements);
let WalkNodesOutput {
static_format,
values,
diagnostics,
collected_elements,
} = other;

self.static_format.push_str(&static_format);
self.values.extend(values);
self.diagnostics.extend(diagnostics);
self.collected_elements.extend(collected_elements);
}
}
impl<'a> syn::visit_mut::VisitMut for WalkNodes<'a> {}
Expand Down

0 comments on commit 9d71054

Please sign in to comment.