From a16648b35133becaef1c67d1f72ee2501a3c73f4 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 22 Mar 2023 10:29:06 +0000 Subject: [PATCH] initialise `output` with a maximum possible length --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d47b0f9..44a4b8c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ impl<'a> TakeWord<'a> for &'a [u8] { fn tag_decode(input: &str) -> String { let mut escaped = false; - let mut output = String::new(); + let mut output = String::with_capacity(input.len()); for char in input.chars() { if escaped {