diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-01-30 09:51:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 09:51:23 +0100 |
commit | 3003d86264680433e789d2726d0d12d2c6267c40 (patch) | |
tree | c7e74c13df73d05ec75ee8feec6416733e1de141 /testing | |
parent | 23326b4765b04cb13dd6c72f2103ff9bd6d44d7d (diff) | |
download | askama-3003d86264680433e789d2726d0d12d2c6267c40.tar.gz askama-3003d86264680433e789d2726d0d12d2c6267c40.tar.bz2 askama-3003d86264680433e789d2726d0d12d2c6267c40.zip |
Apply clippy suggestions for 1.67 (#769)
Diffstat (limited to 'testing')
-rw-r--r-- | testing/Cargo.toml | 3 | ||||
-rw-r--r-- | testing/tests/filters.rs | 3 | ||||
-rw-r--r-- | testing/tests/simple.rs | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/testing/Cargo.toml b/testing/Cargo.toml index cd7d686..e1f1bb4 100644 --- a/testing/Cargo.toml +++ b/testing/Cargo.toml @@ -3,7 +3,8 @@ name = "askama_testing" version = "0.1.0" authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"] workspace = ".." -edition = "2018" +edition = "2021" +rust-version = "1.58" publish = false [features] diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs index 5229ecd..b397e28 100644 --- a/testing/tests/filters.rs +++ b/testing/tests/filters.rs @@ -122,8 +122,7 @@ mod filters { } // for test_nested_filter_ref pub fn mytrim(s: &dyn (::std::fmt::Display)) -> ::askama::Result<String> { - let s = format!("{}", s); - Ok(s.trim().to_owned()) + Ok(s.to_string().trim().to_owned()) } } diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index ebc8267..627a8a3 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -311,14 +311,14 @@ struct FunctionRefTemplate { #[test] fn test_func_ref_call() { let t = FunctionRefTemplate { - world: |s, r| format!("world({}, {})", s, r), + world: |s, r| format!("world({s}, {r})"), }; assert_eq!(t.render().unwrap(), "Hello, world(123, 4)!"); } #[allow(clippy::trivially_copy_pass_by_ref)] fn world2(s: &str, v: u8) -> String { - format!("world{}{}", v, s) + format!("world{v}{s}") } #[derive(Template)] @@ -346,7 +346,7 @@ struct FunctionTemplate; impl FunctionTemplate { #[allow(clippy::trivially_copy_pass_by_ref)] fn world3(&self, s: &str, v: u8) -> String { - format!("world{}{}", s, v) + format!("world{s}{v}") } } |