From 6e754506d8f38b987ba4a4e67f19e8c2ad9f9b66 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Thu, 1 Jul 2021 20:04:00 +0200 Subject: Remove needless deref, only to ref it a few lines down --- askama_shared/src/generator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'askama_shared') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index f143469..eb6b514 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -822,7 +822,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { let mut expr_buf = Buffer::new(0); self.visit_expr(&mut expr_buf, val)?; - match *var { + match var { Target::Name(name) => { let name = normalize_identifier(name); let meta = self.locals.get(&name).cloned(); @@ -840,7 +840,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { self.locals.insert(name, LocalMeta::initialized()); } - Target::Tuple(ref targets) => { + Target::Tuple(targets) => { let shadowed = targets.iter().any(|name| { let name = normalize_identifier(name); matches!(self.locals.get(&name), Some(meta) if meta.initialized) @@ -1518,13 +1518,13 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { } fn visit_target(&mut self, buf: &mut Buffer, target: &Target<'a>) { - match *target { + match target { Target::Name(name) => { let name = normalize_identifier(name); self.locals.insert_with_default(name); buf.write(name); } - Target::Tuple(ref targets) => { + Target::Tuple(targets) => { buf.write("("); for name in targets { self.visit_target(buf, &Target::Name(name)); -- cgit