Skip to content

Commit

Permalink
Fix Value::Map reserve_exact
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Sep 4, 2023
1 parent cf63532 commit 122abf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl<'de> Visitor<'de> for ValueVisitor {
#[cfg(feature = "indexmap")]
if let Some(cap) = map.size_hint() {
panic!();
map.reserve_exact(cap);
res.0.reserve_exact(cap);
}

while let Some(entry) = map.next_entry()? {
Expand Down
2 changes: 1 addition & 1 deletion src/value/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::Value;
/// to preserve the order of the parsed map.
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(transparent)]
pub struct Map(MapInner);
pub struct Map(pub(crate) MapInner);

#[cfg(not(feature = "indexmap"))]
type MapInner = std::collections::BTreeMap<Value, Value>;
Expand Down

0 comments on commit 122abf4

Please sign in to comment.