Skip to content

Commit

Permalink
Rework features
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed May 4, 2020
1 parent 005115f commit 8bb2406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ doctest = true
doc = true

[features]
default = [ "num-traits" ]
default = [ "ratio" ]
ratio = [ "num-traits" ]
std = [ ]

[dependencies]
num-traits = { version = "0.2", default-features = false, optional = true }
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@
//!
//! [https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/)
#![no_std]

#[cfg(feature="num-traits")]
extern crate num_traits;
#![cfg_attr(not(feature = "std"), no_std)]

#[macro_use]
mod macros;
Expand All @@ -187,7 +184,7 @@ pub use self::ulps_eq::ApproxEqUlps;
mod eq;
pub use self::eq::{ApproxEq, F32Margin, F64Margin};

#[cfg(feature="num-traits")]
#[cfg(feature="ratio")]
mod ratio;
#[cfg(feature="num-traits")]
#[cfg(feature="ratio")]
pub use self::ratio::ApproxEqRatio;

0 comments on commit 8bb2406

Please sign in to comment.