From 46adc115efd583cc0956029d63af7ed0bedd77a8 Mon Sep 17 00:00:00 2001 From: Taylor Holliday Date: Wed, 13 Dec 2023 08:17:33 -0800 Subject: [PATCH] #53 Don't use Context directly --- examples/counter.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/counter.rs b/examples/counter.rs index a468724e..b9802d9f 100644 --- a/examples/counter.rs +++ b/examples/counter.rs @@ -3,11 +3,12 @@ use rui::*; fn main() { rui(state( || 1, - |count, cx| { + |count, _| { vstack(( - cx[count].padding(Auto), - button("increment", move |cx| { - cx[count] += 1; + (*count).padding(Auto), + button("increment", move |_| { + let mut c = count; + *c += 1; }) .padding(Auto), ))