diff --git a/src/lib.rs b/src/lib.rs index 2c907e6..a94bbd4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -118,10 +118,6 @@ pub use cpal::{ SupportedStreamConfig, }; -#[cfg(test)] -#[macro_use] -extern crate assert_float_eq; - mod conversions; mod sink; mod spatial_sink; @@ -140,3 +136,7 @@ pub use crate::sink::Sink; pub use crate::source::Source; pub use crate::spatial_sink::SpatialSink; pub use crate::stream::{OutputStream, OutputStreamHandle, PlayError, StreamError}; + +#[cfg(test)] +#[macro_use] +extern crate assert_float_eq; diff --git a/src/source/linear_ramp.rs b/src/source/linear_ramp.rs index 41a313c..d978bd5 100644 --- a/src/source/linear_ramp.rs +++ b/src/source/linear_ramp.rs @@ -169,7 +169,7 @@ mod tests { let source1 = const_source(10, 1.0f32); let mut faded = linear_gain_ramp(source1, Duration::from_secs(4), 0.0, 1.0, true); - assert_float_absolute_eq!(faded.next().unwrap(), 0.0); + assert_eq!(faded.next(), Some(0.0)); assert_eq!(faded.next(), Some(0.25)); assert_eq!(faded.next(), Some(0.5)); assert_eq!(faded.next(), Some(0.75));