tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 8TOML 3CSS 1317 Definiciones

Update the basic example to use the new API

e1a78dd2c2942a2ddb694b61cb0c6b9c4b96b387 · por David Flemström · (hace 6 años) · padre 34c80340f · ver el árbol en este commit

Delta semántico · 1

examples/basic.rs

  • cambió por dentro fn main

1 archivos · +2 −2

diff --git a/examples/basic.rs b/examples/basic.rs
index e1dcea99e..d80564393 100644
--- a/examples/basic.rs
+++ b/examples/basic.rs
@@ -5,7 +5,7 @@ fn main() -> Result<(), stretch::Error> {
     let mut stretch = stretch::node::Stretch::new();
     let child = stretch.new_node(
         Style { size: Size { width: Dimension::Percent(0.5), height: Dimension::Auto }, ..Default::default() },
-        vec![],
+        &[],
     )?;
     let node = stretch.new_node(
         Style {
@@ -13,7 +13,7 @@ fn main() -> Result<(), stretch::Error> {
             justify_content: JustifyContent::Center,
             ..Default::default()
         },
-        vec![child],
+        &[child],
     )?;
 
     stretch.compute_layout(node, Size::undefined())?;