gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 497HTML 254C 19JavaScript 81329 Definiciones

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

2f8ee0713dd50570116065547fca8efc1786bafb · por Nico Burns · (hace 3 años) · padre ae87fd028 · ver el árbol en este commit

Delta semántico

Ninguna definición cambió: el cambio es de texto, documentación o datos.

2 archivos · +5 −2

diff --git a/Cargo.toml b/Cargo.toml
index 0dd5e477a..e9a3e2095 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,13 +19,13 @@ num-traits = { version = "0.2", default-features = false }
 rand = { version = "0.8.5", optional = true }
 serde = { version = "1.0", optional = true, features = ["serde_derive"] }
 slotmap = "1.0.6"
-grid = { version = "0.9.0", optional = true }
+grid = { version = "0.10.0", default-features = false, optional = true }
 
 [features]
 default = ["std", "grid"]
 grid = ["alloc", "dep:grid"]
 alloc = []
-std = ["num-traits/std"]
+std = ["num-traits/std", "grid?/std"]
 serde = ["dep:serde"]
 random = ["dep:rand"]
 yoga_benchmark = []
diff --git a/src/compute/grid/explicit_grid.rs b/src/compute/grid/explicit_grid.rs
index ef04a61fb..8f7125f33 100644
--- a/src/compute/grid/explicit_grid.rs
+++ b/src/compute/grid/explicit_grid.rs
@@ -9,6 +9,9 @@ use crate::style_helpers::TaffyAuto;
 use crate::sys::{GridTrackVec, Vec};
 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)