Improve public API & add docs #4

Merged
schmelczer merged 37 commits from asch/better-api into main 2025-07-06 13:07:51 +01:00
Showing only changes of commit 2a4b5dd496 - Show all commits

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