Replace serde_derive with features = ["derive"] in readme

This commit is contained in:
David Tolnay 2019-01-18 00:29:56 -08:00
parent b605cd1bb9
commit 630501b93d
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -25,19 +25,17 @@ You may be looking for:
<details> <details>
<summary> <summary>
Click to show Cargo.toml. Click to show Cargo.toml.
<a href="https://play.rust-lang.org/?gist=9003c5b88c1f4989941925d7190c6eec" target="_blank">Run this code in the playground.</a> <a href="https://play.rust-lang.org/?edition=2018&gist=72755f28f99afc95e01d63174b28c1f5" target="_blank">Run this code in the playground.</a>
</summary> </summary>
```toml ```toml
[dependencies] [dependencies]
# The core APIs, including the Serialize and Deserialize traits. Always # The core APIs, including the Serialize and Deserialize traits. Always
# required when using Serde. # required when using Serde. The "derive" feature is only required when
serde = "1.0" # using #[derive(Serialize, Deserialize)] to make Serde work with structs
# and enums defined in your crate.
# Support for #[derive(Serialize, Deserialize)]. Required if you want Serde serde = { version = "1.0", features = ["derive"] }
# to work for structs and enums defined in your crate.
serde_derive = "1.0"
# Each data format lives in its own crate; the sample code below uses JSON # Each data format lives in its own crate; the sample code below uses JSON
# but you may be using a different one. # but you may be using a different one.
@ -48,11 +46,7 @@ serde_json = "1.0"
<p></p> <p></p>
```rust ```rust
#[macro_use] use serde::{Serialize, Deserialize};
extern crate serde_derive;
extern crate serde;
extern crate serde_json;
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
struct Point { struct Point {