tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 709HTML 662Markdown 12TOML 62348 Definitions

Upgrade `grid` dependency to `0.10` (#473)

* Upgrade `grid` dependency

* Only enable std feature in grid crate if Taffy's std feature is enabled

* Fix grid+alloc compilation

cec13427feadc6443cae06036f6120710b2ec057 · by Nico Burns · (3 years ago) · parent 129e31a56 · browse the tree at this commit

Semantic delta

No definition changed: this change is text, documentation or data.

2 files · +5 −2

diff --git a/Cargo.toml b/Cargo.toml
index 7d27888e1..48e3db293 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,14 +18,14 @@ arrayvec = { version = "0.7", default-features = false }
 num-traits = { version = "0.2", default-features = false }
 serde = { version = "1.0", optional = true, features = ["serde_derive"] }
 slotmap = { version = "1.0.6", optional = true }
-grid = { version = "0.9.0", optional = true }
+grid = { version = "0.10.0", default-features = false, optional = true }
 
 [features]
 default = ["std", "flexbox", "grid", "taffy_tree"]
 flexbox = []
 grid = ["alloc", "dep:grid"]
 alloc = []
-std = ["num-traits/std"]
+std = ["num-traits/std", "grid?/std"]
 serde = ["dep:serde"]
 debug = []
 profile = []
diff --git a/src/compute/grid/explicit_grid.rs b/src/compute/grid/explicit_grid.rs
index 9cf90dc67..af4b5a18e 100644
--- a/src/compute/grid/explicit_grid.rs
+++ b/src/compute/grid/explicit_grid.rs
@@ -9,6 +9,9 @@ use crate::util::MaybeMath;
 use crate::util::ResolveOrZero;
 use core::cmp::{max, min};
 
+#[cfg(not(feature = "std"))]
+use num_traits::float::FloatCore;
+
 /// Compute the number of rows and columns in the explicit grid
 pub(crate) fn compute_explicit_grid_size_in_axis(style: &Style, axis: AbsoluteAxis) -> u16 {
     // Load the grid-template-rows or grid-template-columns definition (depending on the axis)