aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2021-07-01 20:03:25 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-07-05 10:34:20 +0200
commitdb6c1b2b4af217f797931bbe253eba5ebac3abc5 (patch)
tree9d9ee0f658a9be7e17a2ddebb6ae0158db974dbe /askama_shared/src/generator.rs
parentce4a0932d5d51645942ac5d9920e5246ade72586 (diff)
downloadaskama-db6c1b2b4af217f797931bbe253eba5ebac3abc5.tar.gz
askama-db6c1b2b4af217f797931bbe253eba5ebac3abc5.tar.bz2
askama-db6c1b2b4af217f797931bbe253eba5ebac3abc5.zip
Remove duplicated code in generator
Diffstat (limited to 'askama_shared/src/generator.rs')
-rw-r--r--askama_shared/src/generator.rs18
1 files changed, 1 insertions, 17 deletions
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(";")
}