aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-01-22 17:29:19 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-01-22 17:29:51 +0100
commit6a50939ec2b41b842e3f4d2b71c5792ca4db269b (patch)
tree2e163d1b80df21281cb795f4e1cdea8ff0c520fd /askama_shared/src/lib.rs
parente238032a7441d5174fd62038bc530fa8aa3a90f6 (diff)
downloadaskama-6a50939ec2b41b842e3f4d2b71c5792ca4db269b.tar.gz
askama-6a50939ec2b41b842e3f4d2b71c5792ca4db269b.tar.bz2
askama-6a50939ec2b41b842e3f4d2b71c5792ca4db269b.zip
Cleanup warnings generated by clippy
Diffstat (limited to 'askama_shared/src/lib.rs')
-rw-r--r--askama_shared/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs
index ed2357d..1f145f2 100644
--- a/askama_shared/src/lib.rs
+++ b/askama_shared/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(feature = "cargo-clippy", allow(unused_parens))]
+
#[macro_use]
extern crate error_chain;
#[macro_use]
@@ -59,7 +61,7 @@ impl<'a> Imports<'a> {
pub fn new(parent_nodes: &'a [Node], parent_path: &'a Path) -> Imports<'a> {
let sources = parent_nodes.iter().filter_map(|n| {
match *n {
- Node::Import(_, ref import_path, scope) => {
+ Node::Import(_, import_path, scope) => {
let path = path::find_template_from_path(import_path, Some(parent_path));
let src = path::get_template_source(&path);
Some((scope, Cow::Owned(src)))
@@ -72,8 +74,8 @@ impl<'a> Imports<'a> {
pub fn macro_map(&'a self) -> HashMap<(&'a str, &'a str), Macro<'a>> {
let mut macro_map = HashMap::new();
- for (scope, s) in self.sources.iter() {
- for n in parser::parse(&s.as_ref()) {
+ for (scope, s) in &self.sources {
+ for n in parser::parse(s.as_ref()) {
match n {
Node::Macro(name, m) => macro_map.insert((*scope, name), m),
_ => None,