on master help sign in
Fix doc tests
7fa30a7Nick Fitzgerald
src/cached.rs+1−1
@@ -88,7 +88,7 @@ impl<R> Cached<R> {
88 /// where
88 /// where
89 /// 'a: 'bump,
89 /// 'a: 'bump,
90 /// {
90 /// {
91− /// Node::element(bump, "p", [], [
91+ /// Node::element(bump, "p", [], [], [
92 /// Node::text("Hello, "),
92 /// Node::text("Hello, "),
93 /// Node::text(&self.who),
93 /// Node::text(&self.who),
94 /// Node::text("!"),
94 /// Node::text("!"),
src/lib.rs+5−2
@@ -3,6 +3,9 @@
3//! ## Example
3//! ## Example
4//!
4//!
5//! ```no_run
5//! ```no_run
6+//! use dodrio::{on, bumpalo::Bump, Attribute, Node, Render};
7+//! use wasm_bindgen::UnwrapThrowExt;
8+//!
6//! /// A component that greets someone.
9//! /// A component that greets someone.
7//! pub struct Hello<'who> {
10//! pub struct Hello<'who> {
8//! who: &'who str,
11//! who: &'who str,
@@ -29,10 +32,10 @@
29//! [on(bump, "click", |root, _vdom, _event| {
32//! [on(bump, "click", |root, _vdom, _event| {
30//! let hello = root.unwrap_mut::<Hello>();
33//! let hello = root.unwrap_mut::<Hello>();
31//! let window = web_sys::window().expect_throw("should have a `Window` on the Web");
34//! let window = web_sys::window().expect_throw("should have a `Window` on the Web");
32−//! window.alert(hello.who);
35+//! window.alert_with_message(hello.who);
33//! })],
36//! })],
34//! // Attributes.
37//! // Attributes.
35−//! [Attribute { name: "id", value: &id }],
38+//! [Attribute { name: "id", value: id.into_bump_str() }],
36//! // Child nodes.
39//! // Child nodes.
37//! [
40//! [
38//! Node::text("Hello, "),
41//! Node::text("Hello, "),