From 2a4b5dd496813b1ce5b27507b397c1e8d82c0fec Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 6 Jul 2025 12:28:24 +0100 Subject: [PATCH] Address comment --- src/utils/string_builder.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils/string_builder.rs b/src/utils/string_builder.rs index 1656224..d94134a 100644 --- a/src/utils/string_builder.rs +++ b/src/utils/string_builder.rs @@ -54,9 +54,7 @@ impl StringBuilder<'_> { /// Returns the currently built buffer and clears it to allow consuming /// the result incrementally. pub fn take(&mut self) -> String { - let result = self.buffer.clone(); // TODO: try removing this clone - self.buffer.clear(); - result + std::mem::take(&mut self.buffer) } /// Get a slice of the remaining original string. The slice starts from