aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-07-20 11:07:16 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-07-20 11:07:24 +0200
commit40748eb8e0689af0fd8bb757ae24684d4b770d68 (patch)
tree9412f378af26fc39bcdb92a9d3c4d1b7325599f1 /askama_shared/src
parent42c4cb1d877d696bb97aa2e9402429dad42d7d66 (diff)
downloadaskama-40748eb8e0689af0fd8bb757ae24684d4b770d68.tar.gz
askama-40748eb8e0689af0fd8bb757ae24684d4b770d68.tar.bz2
askama-40748eb8e0689af0fd8bb757ae24684d4b770d68.zip
Clean up clippy issues
Diffstat (limited to '')
-rw-r--r--askama_shared/src/generator.rs15
1 files changed, 7 insertions, 8 deletions
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("{");