From 40748eb8e0689af0fd8bb757ae24684d4b770d68 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 20 Jul 2020 11:07:16 +0200 Subject: Clean up clippy issues --- askama_shared/src/generator.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'askama_shared/src') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index e45acb6..f56ae4b 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -826,10 +826,11 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { return 0; } - if self.buf_writable.iter().all(|w| match w { - Writable::Lit(_) => true, - _ => false, - }) { + if self + .buf_writable + .iter() + .all(|w| matches!(w, Writable::Lit(_))) + { let mut buf_lit = Buffer::new(0); for s in mem::replace(&mut self.buf_writable, vec![]) { if let Writable::Lit(s) = s { @@ -1083,13 +1084,11 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { buf.write("&"); } - let scoped = match *arg { + let scoped = matches!(arg, Expr::Filter(_, _) | Expr::MethodCall(_, _, _) | Expr::VarCall(_, _) - | Expr::PathCall(_, _) => true, - _ => false, - }; + | Expr::PathCall(_, _)); if scoped { buf.writeln("{"); -- cgit