Switch todo!() to unreachable!/unimplemented! where it matters

This commit is contained in:
Jonathan Kelley committed 2024-01-31 16:26:20 -08:00
1 parent a14789eebc
commit 8f07d881a6
27 files changed
+73 -180

No files matched your search

+3 -2
View File
@@ -15,7 +15,7 @@ fn app() -> Element {
// use_effect will subscribe to any changes in the signal values it captures
// effects will always run after first mount and then whenever the signal values change
use_effect(move || println!("Count changed to {}", count()));
use_effect(move || println!("Count changed to {count}"));
// We can do early returns and conditional rendering which will pause all futures that haven't been polled
if count() > 30 {
@@ -49,7 +49,7 @@ fn app() -> Element {
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
button { onclick: move |_| running.toggle(), "Toggle counter" }
button { onclick: move |_| saved_values.push(count().to_string()), "Save this value" }
button { onclick: move |_| saved_values.push(count.to_string()), "Save this value" }
button { onclick: move |_| saved_values.clear(), "Clear saved values" }
// We can do boolean operations on the current signal value
@@ -71,6 +71,7 @@ fn app() -> Element {
// You can pass a value directly to any prop that accepts a signal
Child { count: doubled_count() }
Child { count: doubled_count }
}
}