Skip to content
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

example for json serialization out of date? #18

Open
davidsiefert opened this issue Jan 22, 2019 · 1 comment
Open

example for json serialization out of date? #18

davidsiefert opened this issue Jan 22, 2019 · 1 comment

Comments

@davidsiefert
Copy link

Trying to follow example on nickel-org site for json decoding and it referenced using rustc-serialize. According to the interwebs, rustc-serialize is now deprecated and they recommend using serde (see https://github.com/rust-lang-deprecated/rustc-serialize). Would it be worth updating these docs to use serde as well?

Should be the following changes:

Add two dependencies to Cargo.toml:

serde = { version="0.1.0", features=["derive"] }
serde_json = "1.0"

then in the example, the rust code should use:

use serde::{Deserialize, Serialize};

derive updates to serde's impl:

#[derive(Serialize,Deserialize,Debug)]
struct Person {

and the rest should be the same...

@jolhoeft
Copy link
Member

Ack, I updated nickel to use serde, but I forgot the web pages. Thank you, that looks about right.

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

No branches or pull requests

2 participants