Remove direct usage of 'serde_derive' crate and redundant usage of 'serde' crate (#640)

This commit is contained in:
Kai Ren 2020-04-28 19:39:35 +03:00 committed by GitHub
parent c761d91c69
commit 79c265f027
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 11 additions and 25 deletions

View file

@ -40,8 +40,7 @@ chrono = { version = "0.4.0", optional = true }
fnv = "1.0.3" fnv = "1.0.3"
futures = "0.3.1" futures = "0.3.1"
indexmap = { version = "1.0.0", features = ["serde-1"] } indexmap = { version = "1.0.0", features = ["serde-1"] }
serde = { version = "1.0.8" } serde = { version = "1.0.8", features = ["derive"] }
serde_derive = { version = "1.0.2" }
serde_json = { version="1.0.2", optional = true } serde_json = { version="1.0.2", optional = true }
url = { version = "2", optional = true } url = { version = "2", optional = true }
uuid = { version = "0.8", optional = true } uuid = { version = "0.8", optional = true }

View file

@ -4,10 +4,9 @@ pub mod graphiql;
pub mod playground; pub mod playground;
use serde::{ use serde::{
de::Deserialize, ser::{self, SerializeMap},
ser::{self, Serialize, SerializeMap}, Deserialize, Serialize,
}; };
use serde_derive::{Deserialize, Serialize};
use crate::{ use crate::{
ast::InputValue, ast::InputValue,
@ -218,7 +217,7 @@ where
} }
/// Simple wrapper around GraphQLRequest to allow the handling of Batch requests /// Simple wrapper around GraphQLRequest to allow the handling of Batch requests
#[derive(Debug, serde_derive::Deserialize, PartialEq)] #[derive(Debug, Deserialize, PartialEq)]
#[serde(untagged)] #[serde(untagged)]
#[serde(bound = "InputValue<S>: Deserialize<'de>")] #[serde(bound = "InputValue<S>: Deserialize<'de>")]
pub enum GraphQLBatchRequest<S = DefaultScalarValue> pub enum GraphQLBatchRequest<S = DefaultScalarValue>
@ -308,7 +307,7 @@ where
/// This struct implements Serialize, so you can simply serialize this /// This struct implements Serialize, so you can simply serialize this
/// to JSON and send it over the wire. use the `is_ok` to determine /// to JSON and send it over the wire. use the `is_ok` to determine
/// wheter to send a 200 or 400 HTTP status code. /// wheter to send a 200 or 400 HTTP status code.
#[derive(serde_derive::Serialize)] #[derive(Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub enum GraphQLBatchResponse<'a, S = DefaultScalarValue> pub enum GraphQLBatchResponse<'a, S = DefaultScalarValue>
where where

View file

@ -2,8 +2,8 @@ use indexmap::IndexMap;
use serde::{ use serde::{
de, de,
ser::{self, SerializeMap}, ser::{self, SerializeMap},
Serialize,
}; };
use serde_derive::Serialize;
use std::fmt; use std::fmt;

View file

@ -1,4 +1,4 @@
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{char, convert::From, marker::PhantomData, ops::Deref, u32}; use std::{char, convert::From, marker::PhantomData, ops::Deref, u32};
use crate::{ use crate::{

View file

@ -17,10 +17,9 @@ actix-web-actors = "2.0.0"
futures = { version = "0.3.1", features = ["compat"] } futures = { version = "0.3.1", features = ["compat"] }
juniper = { version = "0.14.2", path = "../juniper", default-features = false } juniper = { version = "0.14.2", path = "../juniper", default-features = false }
tokio = { version = "0.2", features = ["time"] } tokio = { version = "0.2", features = ["time"] }
serde = { version = "1.0.75", features = ["derive"] }
serde_json = "1.0.24" serde_json = "1.0.24"
serde_derive = "1.0.75"
failure = "0.1.7" failure = "0.1.7"
serde = "1.0.75"
[dev-dependencies] [dev-dependencies]
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] } juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }

View file

@ -55,8 +55,8 @@ use juniper::{
}; };
use serde::Deserialize; use serde::Deserialize;
#[serde(deny_unknown_fields)]
#[derive(Deserialize, Clone, PartialEq, Debug)] #[derive(Deserialize, Clone, PartialEq, Debug)]
#[serde(deny_unknown_fields)]
struct GetGraphQLRequest { struct GetGraphQLRequest {
query: String, query: String,
#[serde(rename = "operationName")] #[serde(rename = "operationName")]

View file

@ -9,9 +9,7 @@ repository = "https://github.com/graphql-rust/juniper"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
serde_derive = "1.0"
url = "2" url = "2"
juniper = { version = "0.14.2", default-features = false, path = "../juniper"} juniper = { version = "0.14.2", default-features = false, path = "../juniper"}
tokio = "0.2" tokio = "0.2"

View file

@ -12,9 +12,7 @@ repository = "https://github.com/graphql-rust/juniper"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
serde = { version = "1.0.2" }
serde_json = { version = "1.0.2" } serde_json = { version = "1.0.2" }
serde_derive = { version = "1.0.2" }
juniper = { version = "0.14.2", path = "../juniper" } juniper = { version = "0.14.2", path = "../juniper" }
futures = "0.3.1" futures = "0.3.1"

View file

@ -3,7 +3,6 @@ extern crate juniper;
extern crate juniper_iron; extern crate juniper_iron;
extern crate logger; extern crate logger;
extern crate mount; extern crate mount;
extern crate serde;
use std::env; use std::env;

View file

@ -12,11 +12,8 @@ repository = "https://github.com/graphql-rust/juniper"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
serde = { version = "1.0.2" }
serde_json = { version = "1.0.2" } serde_json = { version = "1.0.2" }
serde_derive = { version = "1.0.2" }
juniper = { version = "0.14.2", default-features = false, path = "../juniper"} juniper = { version = "0.14.2", default-features = false, path = "../juniper"}
rocket = { version = "0.4.2", default-features = false } rocket = { version = "0.4.2", default-features = false }
[dev-dependencies.juniper] [dev-dependencies.juniper]

View file

@ -12,15 +12,13 @@ repository = "https://github.com/graphql-rust/juniper"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
serde = { version = "1.0.2" }
serde_json = { version = "1.0.2" } serde_json = { version = "1.0.2" }
serde_derive = { version = "1.0.2" }
juniper = { version = "0.14.2", default-features = false, path = "../juniper" } juniper = { version = "0.14.2", default-features = false, path = "../juniper" }
futures = { version = "0.3.1", features = ["compat"] } futures = { version = "0.3.1", features = ["compat"] }
rocket = { git = "https://github.com/SergioBenitez/Rocket", branch = "async", default-features = false } rocket = { git = "https://github.com/SergioBenitez/Rocket", branch = "async", default-features = false }
tokio = { version = "0.2", features = ["rt-core", "macros"] } tokio = { version = "0.2", features = ["rt-core", "macros"] }
[dev-dependencies.juniper] [dev-dependencies.juniper]
version = "0.14.1" version = "0.14.2"
features = ["expose-test-schema", "serde_json"] features = ["expose-test-schema", "serde_json"]
path = "../juniper" path = "../juniper"

View file

@ -17,10 +17,9 @@ futures = "0.3.1"
juniper = { version = "0.14.2", path = "../juniper", default-features = false } juniper = { version = "0.14.2", path = "../juniper", default-features = false }
juniper_subscriptions = { path = "../juniper_subscriptions", optional = true} juniper_subscriptions = { path = "../juniper_subscriptions", optional = true}
tokio = { version = "0.2", features = ["rt-core", "blocking"] } tokio = { version = "0.2", features = ["rt-core", "blocking"] }
serde = { version = "1.0.75", features = ["derive"] }
serde_json = "1.0.24" serde_json = "1.0.24"
serde_derive = "1.0.75"
failure = "0.1.7" failure = "0.1.7"
serde = "1.0.75"
[dev-dependencies] [dev-dependencies]
juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] } juniper = { version = "0.14.2", path = "../juniper", features = ["expose-test-schema", "serde_json"] }