Make benches compile

This commit is contained in:
Jonathan Kelley committed 2024-01-30 18:29:49 -08:00
1 parent 09e14f1936
commit 69f9bb6b65
9 files changed
+60 -62

No files matched your search

+4 -2
View File
@@ -25,7 +25,7 @@ fn main() {
}
/// We only have one list of clients for the whole app, so we can use a global signal.
static CLIENTS: GlobalSignal<Vec<Client>> = Signal::global(|| Vec::new());
static CLIENTS: GlobalSignal<Vec<Client>> = Signal::global(Vec::new);
struct Client {
first_name: String,
@@ -93,7 +93,9 @@ fn ClientAdd() -> Element {
oninput: move |e| first_name.set(e.value()),
// when the form mounts, focus the first name input
onmounted: move |e| {e.inner().set_focus(true);},
onmounted: move |e| async move {
_ = e.inner().set_focus(true).await;
},
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ fn main() {
fn app() -> Element {
let mut value = use_signal(|| 0);
let mut depth = use_signal(|| 0 as usize);
let mut depth = use_signal(|| 0_usize);
let items = use_memo(move || (0..depth()).map(|f| f as _).collect::<Vec<isize>>());
let state = use_memo(move || value() + 1);
+1 -1
View File
@@ -6,7 +6,7 @@ fn main() {
fn app() -> Element {
let mut state = use_signal(|| 0);
let mut depth = use_signal(|| 1 as usize);
let mut depth = use_signal(|| 1_usize);
if depth() == 5 {
return rsx! {
+1 -1
View File
@@ -24,7 +24,7 @@ struct TodoItem {
const STYLE: &str = include_str!("./assets/todomvc.css");
fn app() -> Element {
let mut todos = use_signal(|| HashMap::<u32, TodoItem>::new());
let mut todos = use_signal(HashMap::<u32, TodoItem>::new);
let filter = use_signal(|| FilterState::All);
let active_todo_count =
+6 -4
View File
@@ -13,12 +13,14 @@ fn main() {
fn app() -> Element {
let mut focused = use_signal(|| true);
use_wry_event_handler(move |event, _| match event {
WryEvent::WindowEvent {
use_wry_event_handler(move |event, _| {
if let WryEvent::WindowEvent {
event: WindowEvent::Focused(new_focused),
..
} => focused.set(*new_focused),
_ => {}
} = event
{
focused.set(*new_focused)
}
});
rsx! {