File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,14 @@ impl PartialEq for Map<String, Value> {
368
368
369
369
impl Eq for Map < String , Value > { }
370
370
371
+ #[ cfg( not( feature = "preserve_order" ) ) ]
372
+ impl Hash for Map < String , Value > {
373
+ #[ inline]
374
+ fn hash < H : core:: hash:: Hasher > ( & self , state : & mut H ) {
375
+ self . map . hash ( state)
376
+ }
377
+ }
378
+
371
379
/// Access an element of this map. Panics if the given key is not present in the
372
380
/// map.
373
381
///
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ pub use crate::raw::{to_raw_value, RawValue};
113
113
///
114
114
/// See the [`serde_json::value` module documentation](self) for usage examples.
115
115
#[ derive( Clone , Eq , PartialEq ) ]
116
+ #[ cfg_attr( not( feature = "preserve_order" ) , derive( Hash ) ) ]
116
117
pub enum Value {
117
118
/// Represents a JSON null value.
118
119
///
You can’t perform that action at this time.
0 commit comments