Address comment

This commit is contained in:
Andras Schmelczer 2025-07-06 12:28:24 +01:00
parent 4ca9be2496
commit 2a4b5dd496
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -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