From db6c1b2b4af217f797931bbe253eba5ebac3abc5 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Thu, 1 Jul 2021 20:03:25 +0200 Subject: Remove duplicated code in generator --- askama_shared/src/generator.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'askama_shared/src') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index 36c1e6d..f143469 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -807,23 +807,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { self.handle_ws(ws); self.write_buf_writable(buf)?; buf.write("let "); - match *var { - Target::Name(name) => { - let name = normalize_identifier(name); - self.locals.insert_with_default(name); - buf.write(name); - } - Target::Tuple(ref targets) => { - buf.write("("); - for name in targets { - let name = normalize_identifier(name); - self.locals.insert_with_default(name); - buf.write(name); - buf.write(","); - } - buf.write(")"); - } - } + self.visit_target(buf, var); buf.writeln(";") } -- cgit