Skip to content

Commit 58b5fe5

Browse files
committed
Serializers dependencies
1 parent e59ead7 commit 58b5fe5

File tree

8 files changed

+47
-30
lines changed

8 files changed

+47
-30
lines changed

Cargo.toml

+12-13
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ path = "rational"
4040
[dependencies.num-traits]
4141
path = "./traits"
4242

43-
[dependencies.rand]
44-
optional = true
45-
version = "0.3.8"
46-
47-
[dependencies.rustc-serialize]
48-
optional = true
49-
version = "0.3.13"
50-
51-
[dependencies.serde]
52-
optional = true
53-
version = "^0.7.0"
54-
5543
[dev-dependencies]
5644

5745
[dev-dependencies.rand]
@@ -61,4 +49,15 @@ version = "0.3.8"
6149
bigint = ["num-bigint"]
6250
complex = ["num-complex"]
6351
rational = ["num-rational"]
64-
default = ["bigint", "complex", "rand", "rational", "rustc-serialize"]
52+
default = ["bigint", "complex", "rational", "rustc-serialize"]
53+
54+
serde = [
55+
"num-bigint/serde",
56+
"num-complex/serde",
57+
"num-rational/serde"
58+
]
59+
rustc-serialize = [
60+
"num-bigint/rustc-serialize",
61+
"num-complex/rustc-serialize",
62+
"num-rational/rustc-serialize"
63+
]

bigint/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
55
homepage = "https://github.com/rust-num/num"
66
keywords = ["mathematics", "numerics"]
77
license = "MIT/Apache-2.0"
8-
repository = "https://github.com/rust-num/num"
98
name = "num-bigint"
9+
repository = "https://github.com/rust-num/num"
1010
version = "0.1.0"
1111

1212
[dependencies]
@@ -21,9 +21,13 @@ path = "../traits"
2121
optional = true
2222
version = "0.3.14"
2323

24+
[dependencies.rustc-serialize]
25+
optional = true
26+
version = "0.3.19"
27+
2428
[dependencies.serde]
2529
optional = true
2630
version = "0.7.0"
2731

2832
[features]
29-
default = ["rand"]
33+
default = ["rand", "rustc-serialize"]

bigint/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
7373
#[cfg(any(feature = "rand", test))]
7474
extern crate rand;
75+
#[cfg(feature = "rustc-serialize")]
76+
extern crate rustc_serialize;
7577
#[cfg(feature = "serde")]
7678
extern crate serde;
7779

complex/Cargo.toml

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,24 @@ documentation = "http://rust-num.github.io/num"
55
homepage = "https://github.com/rust-num/num"
66
keywords = ["mathematics", "numerics"]
77
license = "MIT/Apache-2.0"
8-
repository = "https://github.com/rust-num/num"
98
name = "num-complex"
9+
repository = "https://github.com/rust-num/num"
1010
version = "0.1.0"
1111

1212
[dependencies]
1313

1414
[dependencies.num-traits]
1515
optional = false
1616
path = "../traits"
17+
18+
[dependencies.rustc-serialize]
19+
optional = true
20+
version = "0.3.19"
21+
22+
[dependencies.serde]
23+
optional = true
24+
version = "^0.7.0"
25+
26+
[features]
27+
default = ["rustc-serialize"]
28+
unstable = []

complex/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
1313
extern crate num_traits as traits;
1414

15+
#[cfg(feature = "rustc-serialize")]
16+
extern crate rustc_serialize;
17+
18+
#[cfg(feature = "serde")]
19+
extern crate serde;
20+
1521
use std::fmt;
1622
#[cfg(test)]
1723
use std::hash;

rational/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ documentation = "http://rust-num.github.io/num"
55
homepage = "https://github.com/rust-num/num"
66
keywords = ["mathematics", "numerics"]
77
license = "MIT/Apache-2.0"
8-
repository = "https://github.com/rust-num/num"
98
name = "num-rational"
9+
repository = "https://github.com/rust-num/num"
1010
version = "0.1.0"
1111

1212
[dependencies]
@@ -21,10 +21,14 @@ path = "../integer"
2121
[dependencies.num-traits]
2222
path = "../traits"
2323

24+
[dependencies.rustc-serialize]
25+
optional = true
26+
version = "0.3.19"
27+
2428
[dependencies.serde]
2529
optional = true
2630
version = "0.7.0"
2731

2832
[features]
29-
default = ["bigint"]
33+
default = ["bigint", "rustc-serialize"]
3034
bigint = ["num-bigint"]

rational/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//! Rational numbers
1212
13+
#[cfg(feature = "rustc-serialize")]
14+
extern crate rustc_serialize;
1315
#[cfg(feature = "serde")]
1416
extern crate serde;
1517
#[cfg(feature = "num-bigint")]

src/lib.rs

-12
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,6 @@ pub extern crate num_bigint;
6767
#[cfg(feature = "num-rational")]
6868
pub extern crate num_rational;
6969

70-
#[cfg(feature = "rustc-serialize")]
71-
extern crate rustc_serialize;
72-
73-
// Some of the tests of non-RNG-based functionality are randomized using the
74-
// RNG-based functionality, so the RNG-based functionality needs to be enabled
75-
// for tests.
76-
#[cfg(any(feature = "rand", all(feature = "bigint", test)))]
77-
extern crate rand;
78-
79-
#[cfg(feature = "serde")]
80-
extern crate serde;
81-
8270
#[cfg(feature = "num-bigint")]
8371
pub use num_bigint::{BigInt, BigUint};
8472
#[cfg(feature = "num-rational")]

0 commit comments

Comments
 (0)