diff --git a/palette/src/blend/blend.rs b/palette/src/blend/blend.rs index 1d3200f19..111c3669b 100644 --- a/palette/src/blend/blend.rs +++ b/palette/src/blend/blend.rs @@ -1,6 +1,6 @@ use num_traits::{One, Zero}; use float::Float; -#[cfg(feature = "libm_works")] +#[cfg(not(feature = "std"))] use num_traits::float::FloatCore; use {cast, clamp, ComponentWise}; diff --git a/palette/src/blend/equations.rs b/palette/src/blend/equations.rs index b3b412ca5..86b576550 100644 --- a/palette/src/blend/equations.rs +++ b/palette/src/blend/equations.rs @@ -1,5 +1,5 @@ use float::Float; -#[cfg(feature = "libm_works")] +#[cfg(not(feature = "std"))] use num_traits::float::FloatCore; use {Blend, ComponentWise}; diff --git a/palette/src/convert.rs b/palette/src/convert.rs index e2f373351..eee150ad5 100644 --- a/palette/src/convert.rs +++ b/palette/src/convert.rs @@ -352,10 +352,12 @@ where /// /// use palette::{Component, Hsv, IntoColor, Pixel, Srgb}; /// use palette::rgb::{Rgb, RgbSpace}; -/// use palette::encoding::Linear; +/// use palette::encoding::{Linear, self}; /// use palette::white_point::D65; /// use palette::float::Float; /// +/// type Hsv64 = Hsv; +/// /// /// sRGB, but with a reversed memory layout. /// #[derive(Copy, Clone, IntoColor, Pixel)] /// #[palette_manual_into(Rgb = "into_rgb_internal")] @@ -391,7 +393,7 @@ where /// 0.7353569830524495, /// 0.5370987304831942, /// ]; -/// let hsv = Bgr::from_raw_slice(&buffer)[1].into(); +/// let hsv: Hsv64 = Bgr::from_raw_slice(&buffer)[1].into(); /// /// assert_relative_eq!(hsv, Hsv::new(90.0, 1.0, 0.5)); /// } @@ -441,7 +443,7 @@ where /// blue: 255, /// alpha: 0.3, /// }; -/// let color = css_color.into(); +/// let color: LinSrgba = css_color.into(); /// /// assert_relative_eq!(color, LinSrgba::new(0.496933, 0.0, 1.0, 0.3)); /// } diff --git a/palette/src/float.rs b/palette/src/float.rs index e9b084d47..35c1356a6 100644 --- a/palette/src/float.rs +++ b/palette/src/float.rs @@ -9,12 +9,13 @@ //! //! [`libm`]: https://github.com/japaric/libm +#[cfg(feature = "std")] pub use num_traits::Float; -#[cfg(feature = "libm_works")] +#[cfg(not(feature = "std"))] pub use self::no_std_float_trait::Float; -#[cfg(feature = "libm_works")] +#[cfg(not(feature = "std"))] mod no_std_float_trait { extern crate libm; use self::libm::{F32Ext, F64Ext}; diff --git a/scripts/test_features.sh b/scripts/test_features.sh index 385773ac7..730c1d9a9 100644 --- a/scripts/test_features.sh +++ b/scripts/test_features.sh @@ -36,10 +36,10 @@ echo -e "features: $features\n" #Test without any optional feature echo testing with --no-default-features --features "$required_features" -cargo test --no-default-features --features "$required_features" +cargo test --release --no-default-features --features "$required_features" #Isolated test of each optional feature for feature in $features; do echo testing with --no-default-features --features "\"$feature $required_features\"" - cargo test --no-default-features --features "$feature $required_features" + cargo test --release --no-default-features --features "$feature $required_features" done