Skip to content

Commit

Permalink
Make the serde dependency non-optional
Browse files Browse the repository at this point in the history
`arangos` depends on `serde` with the `derive` feature anyways
so it is of no use making this optional.
  • Loading branch information
bikeshedder committed Nov 3, 2021
1 parent 0c784fc commit 955db4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
5 changes: 2 additions & 3 deletions arangodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 3 additions & 7 deletions arangodb/src/config.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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,
/// }
Expand All @@ -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.
///
Expand Down
5 changes: 1 addition & 4 deletions arangodb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
3 changes: 1 addition & 2 deletions arangodb/tests/arangodb.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use serde_1::Deserialize;
use serde::Deserialize;

use deadpool_arangodb::Runtime;

Expand All @@ -7,7 +7,6 @@ fn default_dbname() -> String {
}

#[derive(Debug, Default, Deserialize)]
#[serde(crate = "serde_1")]
struct Config {
#[serde(default)]
arango: deadpool_arangodb::Config,
Expand Down

0 comments on commit 955db4f

Please sign in to comment.