We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab0d1c5 commit a84a2dcCopy full SHA for a84a2dc
src/parser.rs
@@ -710,7 +710,7 @@ impl<'a> Parser<'a> {
710
// Given how compilcated reading numbers and strings is, reading objects
711
// is actually pretty simple.
712
fn read_object(&mut self) -> Result<Object> {
713
- let mut object = Object::with_capacity(2);
+ let mut object = Object::with_capacity(3);
714
715
let key = expect!{ self,
716
b'}' => return Ok(object),
@@ -742,7 +742,7 @@ impl<'a> Parser<'a> {
742
fn read_array(&mut self) -> Result<Vec<JsonValue>> {
743
let first = expect_value!{ self, b']' => return Ok(Vec::new()) };
744
745
- let mut array = Vec::with_capacity(3);
+ let mut array = Vec::with_capacity(2);
746
array.push(first);
747
748
loop {
0 commit comments