You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to address issue serde-rs#810.
This implementation works by expanding the contents of the map twice,
first to increment a capacity variable for each element, then actually
inserting them.
In debug mode, this implementation does not appear to optimize out the incrementations
of the capacity variable, so it is likely not a good solution.
zachs18
added a commit
to zachs18/json
that referenced
this issue
Apr 5, 2022
Attempt to address issue serde-rs#810.
This implementation works by expanding the contents of the map twice,
first to produce a capacity value, then actually inserting the elements.
Because it expands the contents of the map twice, when encountering invalid syntax,
it may print error messages twice, which may be unwanted.
Attempt to address issue serde-rs#810.
This implementation works by expanding the contents of the map twice,
first to produce a capacity value, then actually inserting the elements.
Because it expands the contents of the map twice, when encountering invalid syntax,
it may print error messages twice, which may be unwanted.
Currently an invocation like
json!({ "x": 0, "y": 'y' as i8, "z": [] })
expands into:It would be better if it were able to allocate capacity up front, such as by:
The text was updated successfully, but these errors were encountered: