From 37c3ca0eaa40fe5fe809f5833893792464c1e541 Mon Sep 17 00:00:00 2001 From: phantomas Date: Mon, 27 Apr 2026 22:26:51 +0200 Subject: [PATCH 1/2] fix(warn): Fix warning float_literal_f32_fallback --- src/api/layout/v1.rs | 2 +- src/layout/tree.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/layout/v1.rs b/src/api/layout/v1.rs index f7e56c728..5dac4ac44 100644 --- a/src/api/layout/v1.rs +++ b/src/api/layout/v1.rs @@ -113,7 +113,7 @@ impl TryFrom for crate::layout::tree::LayoutNode { top: taffy::LengthPercentageAuto::length(gaps.top), bottom: taffy::LengthPercentageAuto::length(gaps.bottom), }) - .unwrap_or(taffy::Rect::length(0.0)), + .unwrap_or(taffy::Rect::length(0.0_f32)), ..Default::default() }; diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 8bb50d664..74b6f94a1 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -156,7 +156,7 @@ impl LayoutTree { if children.is_empty() { let mut new_node_style = tree.style(node).unwrap().clone(); let prev_margin = new_node_style.margin; - new_node_style.margin = taffy::Rect::length(0.0); + new_node_style.margin = taffy::Rect::length(0.0_f32); tree.set_style(node, new_node_style).unwrap(); let leaf_child = tree From e8afbcddc71edcbcf335047a4d4cb7aa38c391da Mon Sep 17 00:00:00 2001 From: phantomas Date: Mon, 27 Apr 2026 22:48:16 +0200 Subject: [PATCH 2/2] fix(clippy): Fix lint clippy::explicit_counter_loop --- src/util/treediff/zs.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/treediff/zs.rs b/src/util/treediff/zs.rs index 1f318afbe..780b60160 100644 --- a/src/util/treediff/zs.rs +++ b/src/util/treediff/zs.rs @@ -179,16 +179,14 @@ impl<'a, T> ZsTree<'a, T> { kr: Vec::new(), }; - let mut idx = 1; let mut tmp_data = HashMap::new(); - for n in tree.traverse_post_order() { + for (idx, n) in (1..).zip(tree.traverse_post_order()) { tmp_data.insert(n, idx); this.set_i_tree(idx, n); this.set_lld(idx, *tmp_data.get(&get_first_leaf(n)).unwrap()); if n.children().next().is_none() { this.leaf_count += 1; } - idx += 1; } this.set_keyroots();