From 9c44da259489d17356429e3016284dfc3a1cf71a Mon Sep 17 00:00:00 2001 From: Rockie Guo Date: Wed, 29 Nov 2023 08:53:26 +0800 Subject: [PATCH] docs: minor fixes for some code examples in the book (#2077) --- docs/book/src/interlude_projecting_children.md | 6 +++--- docs/book/src/testing.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/book/src/interlude_projecting_children.md b/docs/book/src/interlude_projecting_children.md index 312e63e757..bd46ec7006 100644 --- a/docs/book/src/interlude_projecting_children.md +++ b/docs/book/src/interlude_projecting_children.md @@ -135,17 +135,17 @@ pub fn App() -> impl IntoView { } #[component] -pub fn Outer(ChildrenFn) -> impl IntoView { +pub fn Outer(children: ChildrenFn) -> impl IntoView { children() } #[component] -pub fn Inner(ChildrenFn) -> impl IntoView { +pub fn Inner(children: ChildrenFn) -> impl IntoView { children() } #[component] -pub fn Inmost(ng) -> impl IntoView { +pub fn Inmost(name: String) -> impl IntoView { view! {

{name}

} diff --git a/docs/book/src/testing.md b/docs/book/src/testing.md index bf9f50a461..7e2efbc923 100644 --- a/docs/book/src/testing.md +++ b/docs/book/src/testing.md @@ -30,7 +30,7 @@ pub struct Todos(Vec); impl Todos { pub fn num_remaining(&self) -> usize { - todos.iter().filter(|todo| !todo.completed).sum() + self.0.iter().filter(|todo| !todo.completed).sum() } }