Skip to content

Commit efcd1ac

Browse files
committed
Remove unwraps in README.md.
Accompanies: 4a9ac5e
1 parent f871e38 commit efcd1ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let header_node = taffy
3131
size: Size { width: length(800.0), height: length(100.0) },
3232
..Default::default()
3333
},
34-
).unwrap();
34+
);
3535

3636
let body_node = taffy
3737
.new_leaf(
@@ -40,7 +40,7 @@ let body_node = taffy
4040
flex_grow: 1.0,
4141
..Default::default()
4242
},
43-
).unwrap();
43+
);
4444

4545
let root_node = taffy
4646
.new_with_children(
@@ -51,18 +51,18 @@ let root_node = taffy
5151
},
5252
&[header_node, body_node],
5353
)
54-
.unwrap();
54+
;
5555

5656
// Call compute_layout on the root of your tree to run the layout algorithm
57-
taffy.compute_layout(root_node, Size::MAX_CONTENT).unwrap();
57+
taffy.compute_layout(root_node, Size::MAX_CONTENT);
5858

5959
// Inspect the computed layout using taffy.layout
60-
assert_eq!(taffy.layout(root_node).unwrap().size.width, 800.0);
61-
assert_eq!(taffy.layout(root_node).unwrap().size.height, 600.0);
62-
assert_eq!(taffy.layout(header_node).unwrap().size.width, 800.0);
63-
assert_eq!(taffy.layout(header_node).unwrap().size.height, 100.0);
64-
assert_eq!(taffy.layout(body_node).unwrap().size.width, 800.0);
65-
assert_eq!(taffy.layout(body_node).unwrap().size.height, 500.0); // This value was not set explicitly, but was computed by Taffy
60+
assert_eq!(taffy.layout(root_node).size.width, 800.0);
61+
assert_eq!(taffy.layout(root_node).size.height, 600.0);
62+
assert_eq!(taffy.layout(header_node).size.width, 800.0);
63+
assert_eq!(taffy.layout(header_node).size.height, 100.0);
64+
assert_eq!(taffy.layout(body_node).size.width, 800.0);
65+
assert_eq!(taffy.layout(body_node).size.height, 500.0); // This value was not set explicitly, but was computed by Taffy
6666

6767
```
6868

0 commit comments

Comments
 (0)