Skip to content

Commit

Permalink
Serializers dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth committed Apr 11, 2016
1 parent e59ead7 commit 58b5fe5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 30 deletions.
25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ path = "rational"
[dependencies.num-traits]
path = "./traits"

[dependencies.rand]
optional = true
version = "0.3.8"

[dependencies.rustc-serialize]
optional = true
version = "0.3.13"

[dependencies.serde]
optional = true
version = "^0.7.0"

[dev-dependencies]

[dev-dependencies.rand]
Expand All @@ -61,4 +49,15 @@ version = "0.3.8"
bigint = ["num-bigint"]
complex = ["num-complex"]
rational = ["num-rational"]
default = ["bigint", "complex", "rand", "rational", "rustc-serialize"]
default = ["bigint", "complex", "rational", "rustc-serialize"]

serde = [
"num-bigint/serde",
"num-complex/serde",
"num-rational/serde"
]
rustc-serialize = [
"num-bigint/rustc-serialize",
"num-complex/rustc-serialize",
"num-rational/rustc-serialize"
]
8 changes: 6 additions & 2 deletions bigint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-bigint"
repository = "https://github.com/rust-num/num"
version = "0.1.0"

[dependencies]
Expand All @@ -21,9 +21,13 @@ path = "../traits"
optional = true
version = "0.3.14"

[dependencies.rustc-serialize]
optional = true
version = "0.3.19"

[dependencies.serde]
optional = true
version = "0.7.0"

[features]
default = ["rand"]
default = ["rand", "rustc-serialize"]
2 changes: 2 additions & 0 deletions bigint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
#[cfg(any(feature = "rand", test))]
extern crate rand;
#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature = "serde")]
extern crate serde;

Expand Down
14 changes: 13 additions & 1 deletion complex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-complex"
repository = "https://github.com/rust-num/num"
version = "0.1.0"

[dependencies]

[dependencies.num-traits]
optional = false
path = "../traits"

[dependencies.rustc-serialize]
optional = true
version = "0.3.19"

[dependencies.serde]
optional = true
version = "^0.7.0"

[features]
default = ["rustc-serialize"]
unstable = []
6 changes: 6 additions & 0 deletions complex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
extern crate num_traits as traits;

#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;

#[cfg(feature = "serde")]
extern crate serde;

use std::fmt;
#[cfg(test)]
use std::hash;
Expand Down
8 changes: 6 additions & 2 deletions rational/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-rational"
repository = "https://github.com/rust-num/num"
version = "0.1.0"

[dependencies]
Expand All @@ -21,10 +21,14 @@ path = "../integer"
[dependencies.num-traits]
path = "../traits"

[dependencies.rustc-serialize]
optional = true
version = "0.3.19"

[dependencies.serde]
optional = true
version = "0.7.0"

[features]
default = ["bigint"]
default = ["bigint", "rustc-serialize"]
bigint = ["num-bigint"]
2 changes: 2 additions & 0 deletions rational/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

//! Rational numbers
#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature = "serde")]
extern crate serde;
#[cfg(feature = "num-bigint")]
Expand Down
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ pub extern crate num_bigint;
#[cfg(feature = "num-rational")]
pub extern crate num_rational;

#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;

// Some of the tests of non-RNG-based functionality are randomized using the
// RNG-based functionality, so the RNG-based functionality needs to be enabled
// for tests.
#[cfg(any(feature = "rand", all(feature = "bigint", test)))]
extern crate rand;

#[cfg(feature = "serde")]
extern crate serde;

#[cfg(feature = "num-bigint")]
pub use num_bigint::{BigInt, BigUint};
#[cfg(feature = "num-rational")]
Expand Down

0 comments on commit 58b5fe5

Please sign in to comment.