Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@autozimu
Copy link
Contributor

Which makes conversion from/to other types much easier

Also update rmpv to latest release.

Which makes conversion from/to other types much easier

Also update rmpv to latest release.
@daa84
Copy link
Owner

daa84 commented Oct 25, 2017

Don't understand why serde support make conversion much easier? Currently i use Value::as_* functions, and trait From.
Thanks

@autozimu
Copy link
Contributor Author

WIth with-serde turned on, one can have

#[Deserialize, Serialize]
struct MyStruct {
    foo: String,
    bar: i64,
}

let v = Value;
let s: MyStruct = rmpv::ext::deserialize_from(v).unwrap();

From this point, one can just use s instead of matching and casting.

@daa84
Copy link
Owner

daa84 commented Oct 26, 2017

Looks cool, thanks 👍

@daa84 daa84 merged commit a025401 into daa84:master Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants