diff --git a/Cargo.toml b/Cargo.toml index fdacaef263..bc1a14e580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ complex, rational, range iterators, generic integers, and more! """ [dependencies] +num-traits = { path = "traits" } rand = { version = "0.3.8", optional = true } rustc-serialize = { version = "0.3.13", optional = true } serde = { version = "^0.7.0", optional = true } diff --git a/src/lib.rs b/src/lib.rs index c9a30992ad..159f241cb6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,6 +69,10 @@ extern crate rand; #[cfg(feature = "serde")] extern crate serde; +extern crate num_traits; +// Allow existing code to access traits without changes. +pub use num_traits as traits; + #[cfg(feature = "bigint")] pub use bigint::{BigInt, BigUint}; #[cfg(feature = "rational")] @@ -92,7 +96,6 @@ pub mod bigint; pub mod complex; pub mod integer; pub mod iter; -pub mod traits; #[cfg(feature = "rational")] pub mod rational; diff --git a/traits/Cargo.toml b/traits/Cargo.toml new file mode 100644 index 0000000000..3b492db04e --- /dev/null +++ b/traits/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "num-traits" +version = "0.1.0" +authors = ["The Rust Project Developers"] +license = "MIT/Apache-2.0" +homepage = "https://github.com/rust-num/num" +repository = "https://github.com/rust-num/num" +documentation = "http://rust-num.github.io/num" +keywords = ["mathematics", "numerics", "traits"] +description = """ +A collection of traits for Rust, including implementations on Rust's built-in +numeric types. +""" diff --git a/src/traits.rs b/traits/src/lib.rs similarity index 100% rename from src/traits.rs rename to traits/src/lib.rs