-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add preserve_order feature #80
Conversation
I would strongly prefer to use |
OK. If you like I can update this when it's ready. |
contain-rs/linked-hash-map#54 has finally been merged, now waiting on contain-rs/linked-hash-map#57. |
That one merged too, waiting on a release contain-rs/linked-hash-map#56. |
@@ -824,8 +856,8 @@ impl de::Deserializer for Deserializer { | |||
Some(_) => Err(de::Error::invalid_type(de::Type::Map)), | |||
None => visitor.visit(VariantDeserializer { | |||
de: self, | |||
val: Some(value), | |||
variant: Some(Value::String(variant)), | |||
val: Some(value.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These clones are no longer required.
I released v0.7.2 with this feature. |
I've added a PR for #54
linked-hash-map needs to be released (probably version = "0.0.11") before this can be merged.
I had to use
linked_hash_map::Iter<'a, String, Value>
as a replacement forbtree_map::IntoIter<String, Value>
. This in turn required me to clone keys/values indeserialize_enum
andvisit_key
. I'm not sure this is the best solution.Also since I'm new to Rust and this is my very first PR please check my code thoroughly :)