tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1077HTML 1008Markdown 12TOML 83209 Definitions

evenly_sized_tracks - fix simple compile error (#643)

flex's argument needs to be Into<f32>, a plain float literal is f64 which does not work, I just specified that the argument here is f32

9f27870656a06f125f63b46e37c2038fcca1818e · by DavidM603 · (2 years ago) · parent e8aef0c70 · browse the tree at this commit

Semantic delta · 1

src/style_helpers.rs

1 files · +1 −1

diff --git a/src/style_helpers.rs b/src/style_helpers.rs
index 1f4d43cb9..9701a6a59 100644
--- a/src/style_helpers.rs
+++ b/src/style_helpers.rs
@@ -55,7 +55,7 @@ mod repeat_fn_tests {
 pub fn evenly_sized_tracks(count: u16) -> Vec<TrackSizingFunction> {
     use crate::util::sys::new_vec_with_capacity;
     let mut repeated_tracks = new_vec_with_capacity(1);
-    repeated_tracks.push(flex(1.0));
+    repeated_tracks.push(flex(1.0f32));
     let mut tracks = new_vec_with_capacity(1);
     tracks.push(repeat(count, repeated_tracks));
     tracks