From d1537b4c39bc48b020c9965c0c862207d0060889 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 22 Nov 2023 11:12:59 -0800 Subject: [PATCH] fix: compilation with latest `taffy` commit Also adds `rev =` to `Cargo.toml` specifying the latest commit. A library like `libcosmic` shouldn't use git dependencies without specifying a commit or tag. --- Cargo.toml | 1 + src/widget/grid/layout.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 678d44d..e275b7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,6 +128,7 @@ optional = true [dependencies.taffy] git = "https://github.com/DioxusLabs/taffy" +rev = "7781c70" features = ["grid"] [workspace] diff --git a/src/widget/grid/layout.rs b/src/widget/grid/layout.rs index 1ac77c6..79f6efc 100644 --- a/src/widget/grid/layout.rs +++ b/src/widget/grid/layout.rs @@ -9,7 +9,7 @@ use iced_core::{Alignment, Length, Padding, Point, Size}; use taffy::geometry::{Line, Rect}; use taffy::style::{AlignItems, Dimension, Display, GridPlacement, Style}; use taffy::style_helpers::{auto, length}; -use taffy::Taffy; +use taffy::TaffyTree; #[allow(clippy::too_many_lines)] pub fn resolve( @@ -30,7 +30,7 @@ pub fn resolve( let mut leafs = Vec::with_capacity(items.len()); let mut nodes = Vec::with_capacity(items.len()); - let mut taffy = Taffy::<()>::with_capacity(items.len() + 1); + let mut taffy = TaffyTree::<()>::with_capacity(items.len() + 1); // Attach widgets as child nodes. for (child, assignment) in items.iter().zip(assignments.iter()) {