From 7f1cd3dfc7ed72b9cd31a53774c5aec019287ea0 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Wed, 5 Jan 2022 19:23:26 +0100 Subject: No need to build a String when it gets referenced as &str implicitly --- askama_shared/src/filters/mod.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index 66a0ee2..35bdd5a 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -570,16 +570,10 @@ mod tests { assert_eq!(join(empty.iter(), ", ").unwrap(), ""); let input: Vec = vec!["foo".into(), "bar".into(), "bazz".into()]; - assert_eq!( - join((&input).iter(), ":".to_string()).unwrap(), - "foo:bar:bazz" - ); assert_eq!(join(input.iter(), ":").unwrap(), "foo:bar:bazz"); - assert_eq!(join(input.iter(), ":".to_string()).unwrap(), "foo:bar:bazz"); let input: &[String] = &["foo".into(), "bar".into()]; assert_eq!(join(input.iter(), ":").unwrap(), "foo:bar"); - assert_eq!(join(input.iter(), ":".to_string()).unwrap(), "foo:bar"); let real: String = "blah".into(); let input: Vec<&str> = vec![&real]; -- cgit