aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-01-02 21:21:28 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2020-01-02 22:58:13 +0100
commitea2034e8062f8db6b5ae74ca8aeab4e2ee08479f (patch)
tree207b103539bacd4147c1ee274d3a1aa4938b7853 /testing
parent9085e1e3dd0ae9924433c6e5166c33e0f6d2a283 (diff)
downloadaskama-ea2034e8062f8db6b5ae74ca8aeab4e2ee08479f.tar.gz
askama-ea2034e8062f8db6b5ae74ca8aeab4e2ee08479f.tar.bz2
askama-ea2034e8062f8db6b5ae74ca8aeab4e2ee08479f.zip
Clean up clippy warnings
Diffstat (limited to 'testing')
-rw-r--r--testing/benches/all.rs12
-rw-r--r--testing/tests/filters.rs4
-rw-r--r--testing/tests/matches.rs2
-rw-r--r--testing/tests/operators.rs2
-rw-r--r--testing/tests/simple.rs2
-rw-r--r--testing/tests/vars.rs2
6 files changed, 17 insertions, 7 deletions
diff --git a/testing/benches/all.rs b/testing/benches/all.rs
index 3ce0812..9d605af 100644
--- a/testing/benches/all.rs
+++ b/testing/benches/all.rs
@@ -8,15 +8,15 @@ criterion_main!(benches);
criterion_group!(benches, functions);
fn functions(c: &mut Criterion) {
- c.bench_function("Big table", |b| big_table(b, &100));
+ c.bench_function("Big table", |b| big_table(b, 100));
c.bench_function("Teams", teams);
}
-fn big_table(b: &mut criterion::Bencher, size: &usize) {
- let mut table = Vec::with_capacity(*size);
- for _ in 0..*size {
- let mut inner = Vec::with_capacity(*size);
- for i in 0..*size {
+fn big_table(b: &mut criterion::Bencher, size: usize) {
+ let mut table = Vec::with_capacity(size);
+ for _ in 0..size {
+ let mut inner = Vec::with_capacity(size);
+ for i in 0..size {
inner.push(i);
}
table.push(inner);
diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs
index 4579afe..b02a64b 100644
--- a/testing/tests/filters.rs
+++ b/testing/tests/filters.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::blacklisted_name)]
+
#[cfg(feature = "serde-json")]
#[macro_use]
extern crate serde_json;
@@ -44,7 +46,7 @@ struct MyFilterTemplate<'a> {
mod filters {
pub fn myfilter(s: &str) -> ::askama::Result<String> {
- Ok(s.replace("oo", "aa").to_string())
+ Ok(s.replace("oo", "aa"))
}
// for test_nested_filter_ref
pub fn mytrim(s: &dyn (::std::fmt::Display)) -> ::askama::Result<String> {
diff --git a/testing/tests/matches.rs b/testing/tests/matches.rs
index 8657fa5..3e6d636 100644
--- a/testing/tests/matches.rs
+++ b/testing/tests/matches.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::blacklisted_name)]
+
use askama::Template;
#[derive(Template)]
diff --git a/testing/tests/operators.rs b/testing/tests/operators.rs
index d6c3cae..99a2a4c 100644
--- a/testing/tests/operators.rs
+++ b/testing/tests/operators.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::blacklisted_name)]
+
use askama::Template;
#[derive(Template)]
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index a311e90..6dbfcfb 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::blacklisted_name)]
+
use askama::{SizedTemplate, Template};
use std::collections::HashMap;
diff --git a/testing/tests/vars.rs b/testing/tests/vars.rs
index 0e1e367..3af41c6 100644
--- a/testing/tests/vars.rs
+++ b/testing/tests/vars.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::useless_let_if_seq)]
+
use askama::Template;
#[derive(Template)]