diff --git a/src/style_helpers.rs b/src/style_helpers.rs
index b654e8923..74275b3a5 100644
--- a/src/style_helpers.rs
+++ b/src/style_helpers.rs
@@ -1,5 +1,4 @@
//! Helper functions which it make it easier to create instances of types in the `style` and `geometry` modules.
-use crate::sys::Vec;
use crate::{
geometry::{Line, Point, Rect, Size},
style::LengthPercentage,
@@ -7,6 +6,7 @@ use crate::{
#[cfg(feature = "grid")]
use crate::{
+ sys::Vec,
geometry::MinMax,
style::{
GridTrackRepetition, MaxTrackSizingFunction, MinTrackSizingFunction, NonRepeatedTrackSizingFunction,
diff --git a/src/sys.rs b/src/sys.rs
index 40c01f42c..fb1f65ccb 100644
--- a/src/sys.rs
+++ b/src/sys.rs
@@ -21,8 +21,8 @@ mod std {
pub(crate) type Vec<A> = std::vec::Vec<A>;
/// A vector of child nodes
pub(crate) type ChildrenVec<A> = std::vec::Vec<A>;
- /// A vector of grid tracks
#[cfg(feature = "grid")]
+ /// A vector of grid tracks
pub(crate) type GridTrackVec<A> = std::vec::Vec<A>;
/// Creates a new vector with the capacity for the specified number of items before it must be resized
@@ -45,13 +45,13 @@ mod std {
/// Returns the largest of two f32 values
pub(crate) fn f32_max(a: f32, b: f32) -> f32 {
- std::cmp::max_by(a, b, |a, b| a.total_cmp(&b))
+ std::cmp::max_by(a, b, |a, b| a.total_cmp(b))
}
/// Returns the smallest of two f32 values
#[cfg(feature = "grid")]
pub(crate) fn f32_min(a: f32, b: f32) -> f32 {
- std::cmp::min_by(a, b, |a, b| a.total_cmp(&b))
+ std::cmp::min_by(a, b, |a, b| a.total_cmp(b))
}
}
@@ -67,6 +67,7 @@ mod alloc {
pub(crate) type Vec<A> = alloc::vec::Vec<A>;
/// A vector of child nodes
pub(crate) type ChildrenVec<A> = alloc::vec::Vec<A>;
+ #[cfg(feature = "grid")]
/// A vector of grid tracks
pub(crate) type GridTrackVec<A> = alloc::vec::Vec<A>;
@@ -115,6 +116,7 @@ mod core {
pub const MAX_NODE_COUNT: usize = 256;
/// The maximum number of children of any given node
pub const MAX_CHILD_COUNT: usize = 16;
+ #[cfg(feature = "grid")]
/// The maximum number of children of any given node
pub const MAX_GRID_TRACKS: usize = 16;
@@ -122,6 +124,7 @@ mod core {
pub(crate) type Vec<A> = arrayvec::ArrayVec<A, MAX_NODE_COUNT>;
/// A vector of child nodes, whose length cannot exceed [`MAX_CHILD_COUNT`]
pub(crate) type ChildrenVec<A> = arrayvec::ArrayVec<A, MAX_CHILD_COUNT>;
+ #[cfg(feature = "grid")]
/// A vector of grid tracks
pub(crate) type GridTrackVec<A> = arrayvec::ArrayVec<A, MAX_GRID_TRACKS>;