From 09d9d6a3e7b9eddfadba2480450814f4cc54813d Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 1 Aug 2023 19:26:15 +0100 Subject: [PATCH] address new clippy lints --- actix-router/src/resource.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actix-router/src/resource.rs b/actix-router/src/resource.rs index a3e89a1fe..80c0a2d68 100644 --- a/actix-router/src/resource.rs +++ b/actix-router/src/resource.rs @@ -501,7 +501,12 @@ impl ResourceDef { let patterns = self .pattern_iter() .flat_map(move |this| other.pattern_iter().map(move |other| (this, other))) - .map(|(this, other)| [this, other].join("")) + .map(|(this, other)| { + let mut pattern = String::with_capacity(this.len() + other.len()); + pattern.push_str(this); + pattern.push_str(other); + pattern + }) .collect::>(); match patterns.len() {