Serializers dependencies

This commit is contained in:
Łukasz Jan Niemier 2016-04-11 20:43:07 +02:00
parent e59ead7b3a
commit 58b5fe5883
8 changed files with 47 additions and 30 deletions

View File

@ -40,18 +40,6 @@ path = "rational"
[dependencies.num-traits] [dependencies.num-traits]
path = "./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]
[dev-dependencies.rand] [dev-dependencies.rand]
@ -61,4 +49,15 @@ version = "0.3.8"
bigint = ["num-bigint"] bigint = ["num-bigint"]
complex = ["num-complex"] complex = ["num-complex"]
rational = ["num-rational"] 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"
]

View File

@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num" homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"] keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-bigint" name = "num-bigint"
repository = "https://github.com/rust-num/num"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
@ -21,9 +21,13 @@ path = "../traits"
optional = true optional = true
version = "0.3.14" version = "0.3.14"
[dependencies.rustc-serialize]
optional = true
version = "0.3.19"
[dependencies.serde] [dependencies.serde]
optional = true optional = true
version = "0.7.0" version = "0.7.0"
[features] [features]
default = ["rand"] default = ["rand", "rustc-serialize"]

View File

@ -72,6 +72,8 @@
#[cfg(any(feature = "rand", test))] #[cfg(any(feature = "rand", test))]
extern crate rand; extern crate rand;
#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
extern crate serde; extern crate serde;

View File

@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num" homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"] keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-complex" name = "num-complex"
repository = "https://github.com/rust-num/num"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
@ -14,3 +14,15 @@ version = "0.1.0"
[dependencies.num-traits] [dependencies.num-traits]
optional = false optional = false
path = "../traits" path = "../traits"
[dependencies.rustc-serialize]
optional = true
version = "0.3.19"
[dependencies.serde]
optional = true
version = "^0.7.0"
[features]
default = ["rustc-serialize"]
unstable = []

View File

@ -12,6 +12,12 @@
extern crate num_traits as traits; extern crate num_traits as traits;
#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature = "serde")]
extern crate serde;
use std::fmt; use std::fmt;
#[cfg(test)] #[cfg(test)]
use std::hash; use std::hash;

View File

@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num" homepage = "https://github.com/rust-num/num"
keywords = ["mathematics", "numerics"] keywords = ["mathematics", "numerics"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num-rational" name = "num-rational"
repository = "https://github.com/rust-num/num"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
@ -21,10 +21,14 @@ path = "../integer"
[dependencies.num-traits] [dependencies.num-traits]
path = "../traits" path = "../traits"
[dependencies.rustc-serialize]
optional = true
version = "0.3.19"
[dependencies.serde] [dependencies.serde]
optional = true optional = true
version = "0.7.0" version = "0.7.0"
[features] [features]
default = ["bigint"] default = ["bigint", "rustc-serialize"]
bigint = ["num-bigint"] bigint = ["num-bigint"]

View File

@ -10,6 +10,8 @@
//! Rational numbers //! Rational numbers
#[cfg(feature = "rustc-serialize")]
extern crate rustc_serialize;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
extern crate serde; extern crate serde;
#[cfg(feature = "num-bigint")] #[cfg(feature = "num-bigint")]

View File

@ -67,18 +67,6 @@ pub extern crate num_bigint;
#[cfg(feature = "num-rational")] #[cfg(feature = "num-rational")]
pub extern crate 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")] #[cfg(feature = "num-bigint")]
pub use num_bigint::{BigInt, BigUint}; pub use num_bigint::{BigInt, BigUint};
#[cfg(feature = "num-rational")] #[cfg(feature = "num-rational")]