From 630501b93d09a2eb7149c9d9b7871bdd31a77961 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Jan 2019 00:29:56 -0800 Subject: [PATCH] Replace serde_derive with features = ["derive"] in readme --- README.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 77de3a4a..b2626db9 100644 --- a/README.md +++ b/README.md @@ -25,19 +25,17 @@ You may be looking for:
Click to show Cargo.toml. -Run this code in the playground. +Run this code in the playground. ```toml [dependencies] # The core APIs, including the Serialize and Deserialize traits. Always -# required when using Serde. -serde = "1.0" - -# Support for #[derive(Serialize, Deserialize)]. Required if you want Serde -# to work for structs and enums defined in your crate. -serde_derive = "1.0" +# required when using Serde. The "derive" feature is only required when +# using #[derive(Serialize, Deserialize)] to make Serde work with structs +# and enums defined in your crate. +serde = { version = "1.0", features = ["derive"] } # Each data format lives in its own crate; the sample code below uses JSON # but you may be using a different one. @@ -48,11 +46,7 @@ serde_json = "1.0"

```rust -#[macro_use] -extern crate serde_derive; - -extern crate serde; -extern crate serde_json; +use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug)] struct Point {