According to the actual use case of serde_yaml, impl fn entry_or_insert() for Mapping.
/// Ensures a key's corresponding value is in the entry by inserting
/// the default if empty.
/// Returns a mutable reference to the value in the entry.
#[inline]
pub fn entry_or_insert(&mut self, k: Value, default: Value) -> &mut Value {
self.map.entry(k).or_insert(default)
}
Also, I released my new crate ritelinked, which supports LinkedHashMap and LinkedHashSet, provides better performance in some cases and is under active maintenance, would you consider using it to replace linked-hash-map ?
According to the actual use case of
serde_yaml
, implfn entry_or_insert()
forMapping
.Relate https://github.com/dtolnay/serde-yaml/issues/58 . We don’t need to implement our own
entry()
API, but only need to combine the existing interfaces.Also, I released my new crate
ritelinked
, which supportsLinkedHashMap
andLinkedHashSet
, provides better performance in some cases and is under active maintenance, would you consider using it to replacelinked-hash-map
?