Skip to content

Commit b381dc9

Browse files
committed
WIP no-std-check OK
- `cargo +nightly-2022-10-22 no-std-check --no-default-features --features=alloc` OK - `cargo test --no-default-features --features=alloc` OK
1 parent 58e7cef commit b381dc9

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/color.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ use num_traits::{NumCast, ToPrimitive, Zero};
44

55
use crate::traits::{Enlargeable, Pixel, Primitive};
66

7+
#[cfg(not(feature = "std"))]
8+
use num_traits::float::FloatCore;
9+
710
/// An enumeration over supported color types and bit depths
811
#[derive(Copy, PartialEq, Eq, Debug, Clone, Hash)]
912
#[non_exhaustive]

src/imageops/colorops.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ use alloc::vec::Vec;
33
use core::f64::consts::PI;
44
use num_traits::NumCast;
55

6+
#[cfg(not(feature = "std"))]
7+
use num_traits::Float;
8+
69
use crate::color::{FromColor, IntoColor, Luma, LumaA, Rgba};
710
use crate::image::{GenericImage, GenericImageView};
811
use crate::traits::{Pixel, Primitive};

src/imageops/sample.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use core::f32;
88

99
use num_traits::{NumCast, ToPrimitive, Zero};
1010

11+
#[cfg(not(feature = "std"))]
12+
use num_traits::Float;
13+
1114
use crate::image::{GenericImage, GenericImageView};
1215
use crate::traits::{Enlargeable, Pixel, Primitive};
1316
use crate::utils::clamp;

src/math/utils.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
33
use core::cmp::max;
44

5+
#[cfg(not(feature = "std"))]
6+
use num_traits::Float;
7+
58
/// Calculates the width and height an image should be resized to.
69
/// This preserves aspect ratio, and based on the `fill` parameter
710
/// will either fill the dimensions to fit inside the smaller constraint

0 commit comments

Comments
 (0)