index: fix formatting and warnings
1use stretch::geometry::Size;
2use stretch::style::*;
3
4fn main() -> Result<(), stretch::Error> {
5 let mut stretch = stretch::node::Stretch::new();
6 let child = stretch.new_node(
7 Style { size: Size { width: Dimension::Percent(0.5), height: Dimension::Auto }, ..Default::default() },
8 vec![],
9 )?;
10 let node = stretch.new_node(
11 Style {
12 size: Size { width: Dimension::Points(100.0), height: Dimension::Points(100.0) },
13 justify_content: JustifyContent::Center,
14 ..Default::default()
15 },
16 vec![child],
17 )?;
18
19 stretch.compute_layout(node, Size::undefined())?;
20 println!("node: {:#?}", stretch.layout(node)?);
21 println!("child: {:#?}", stretch.layout(child)?);
22
23 Ok(())
24}