From 955db4fee6cc1790664150231a5bf2e2203569f2 Mon Sep 17 00:00:00 2001 From: "Michael P. Jung" Date: Wed, 3 Nov 2021 12:51:39 +0100 Subject: [PATCH] Make the `serde` dependency non-optional `arangos` depends on `serde` with the `derive` feature anyways so it is of no use making this optional. --- arangodb/Cargo.toml | 5 ++--- arangodb/src/config.rs | 10 +++------- arangodb/src/lib.rs | 5 +---- arangodb/tests/arangodb.rs | 3 +-- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/arangodb/Cargo.toml b/arangodb/Cargo.toml index 722c0099..69f55c9c 100644 --- a/arangodb/Cargo.toml +++ b/arangodb/Cargo.toml @@ -17,12 +17,11 @@ all-features = true default = ["rt_tokio_1"] rt_tokio_1 = ["deadpool/rt_tokio_1", "arangors/reqwest_async"] rt_async-std_1 = ["deadpool/rt_async-std_1", "arangors/surf_async"] -serde = ["deadpool/serde", "serde_1"] [dependencies] -deadpool = { path = "../", version = "0.9.0", default-features = false, features = ["managed"] } +deadpool = { path = "../", version = "0.9.0", default-features = false, features = ["managed", "serde"] } arangors = { git = "https://github.com/fMeow/arangors", rev = "2c31587", default-features = false, features = ["rocksdb"] } -serde_1 = { package = "serde", version = "1.0", features = ["derive"], optional = true } +serde = { version = "1.0", features = ["derive"] } url = "2.2" [dev-dependencies] diff --git a/arangodb/src/config.rs b/arangodb/src/config.rs index 916cae5b..e82df923 100644 --- a/arangodb/src/config.rs +++ b/arangodb/src/config.rs @@ -1,8 +1,7 @@ use std::fmt; use deadpool::Runtime; -#[cfg(feature = "serde")] -use serde_1::Deserialize; +use serde::Deserialize; use url::Url; use crate::{CreatePoolError, Pool, PoolConfig}; @@ -23,10 +22,9 @@ use crate::{CreatePoolError, Pool, PoolConfig}; /// ARANGODB__POOL__TIMEOUTS__WAIT__NANOS=0 /// ``` /// ```rust -/// # use serde_1 as serde; +/// # use serde; /// # /// #[derive(serde::Deserialize)] -/// # #[serde(crate = "serde_1")] /// struct Config { /// arango: deadpool_arangodb::Config, /// } @@ -39,9 +37,7 @@ use crate::{CreatePoolError, Pool, PoolConfig}; /// } /// } /// ``` -#[derive(Clone, Debug)] -#[cfg_attr(feature = "serde", derive(serde_1::Deserialize))] -#[cfg_attr(feature = "serde", serde(crate = "serde_1"))] +#[derive(Clone, Debug, Deserialize)] pub struct Config { /// ArangoDB URL. /// diff --git a/arangodb/src/lib.rs b/arangodb/src/lib.rs index 3f425c62..43d41399 100644 --- a/arangodb/src/lib.rs +++ b/arangodb/src/lib.rs @@ -22,10 +22,7 @@ mod config; -use std::{ - convert::Infallible, - ops::{Deref, DerefMut}, -}; +use std::ops::{Deref, DerefMut}; use arangors::{uclient::ClientExt, ClientError, Connection as ArangoConnection}; use deadpool::{async_trait, managed}; diff --git a/arangodb/tests/arangodb.rs b/arangodb/tests/arangodb.rs index 026e0dac..a0ee045e 100644 --- a/arangodb/tests/arangodb.rs +++ b/arangodb/tests/arangodb.rs @@ -1,4 +1,4 @@ -use serde_1::Deserialize; +use serde::Deserialize; use deadpool_arangodb::Runtime; @@ -7,7 +7,6 @@ fn default_dbname() -> String { } #[derive(Debug, Default, Deserialize)] -#[serde(crate = "serde_1")] struct Config { #[serde(default)] arango: deadpool_arangodb::Config,