docs: minor fixes for some code examples in the book (#2077)

This commit is contained in:
Rockie Guo 2023-11-29 08:53:26 +08:00 committed by GitHub
parent 75c27e0b85
commit 9c44da2594
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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! {
<p>{name}</p>
}

View file

@ -30,7 +30,7 @@ pub struct Todos(Vec<Todo>);
impl Todos {
pub fn num_remaining(&self) -> usize {
todos.iter().filter(|todo| !todo.completed).sum()
self.0.iter().filter(|todo| !todo.completed).sum()
}
}