on master help sign in
examples/hello-world: use the builder for rendering
c0da61aNick Fitzgerald
examples/hello-world/src/lib.rs+4−11
@@ -15,17 +15,10 @@ impl<'who> Render for Hello<'who> {
15 where
15 where
16 'a: 'bump,
16 'a: 'bump,
17 {
17 {
18− Node::element(
18+ use dodrio::builder::*;
19− bump,
19+ p(bump)
20− // The element's tag name. In this case a `<p>` element.
21− "p",
22− // Event listeners. Empty in this case.
23− [],
24− // Attributes. Again, empty in this case.
25− [],
26− // Child nodes.
27− [Node::text("Hello, "), Node::text(self.who), Node::text("!")],
20+ .children([text("Hello, "), text(self.who), text("!")])
28− )
21+ .finish()
29 }
22 }
30}
23}
31
24