mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-11 03:04:22 +01:00
increasing string capacity to reduce allocations
This commit is contained in:
@@ -685,7 +685,7 @@ pub fn json_quote(value: &OwnedValue) -> crate::Result<OwnedValue> {
|
||||
return Ok(value.to_owned());
|
||||
}
|
||||
|
||||
let mut escaped_value = String::with_capacity(t.value.len());
|
||||
let mut escaped_value = String::with_capacity(t.value.len() + 4);
|
||||
escaped_value.push('"');
|
||||
for c in t.value.to_string_lossy().chars() {
|
||||
match c {
|
||||
|
||||
Reference in New Issue
Block a user