From 9d7105473157ec7245e42615fafd6383f291d01b Mon Sep 17 00:00:00 2001 From: Peter Hayman Date: Tue, 14 Jan 2025 22:14:09 +1100 Subject: [PATCH] refactor: destructure WalkNodesOutput extend --- examples/html-to-string-macro/src/lib.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/html-to-string-macro/src/lib.rs b/examples/html-to-string-macro/src/lib.rs index c805cdf..8369502 100644 --- a/examples/html-to-string-macro/src/lib.rs +++ b/examples/html-to-string-macro/src/lib.rs @@ -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> {}