diff --git a/yewprint-doc/src/app.rs b/yewprint-doc/src/app.rs index 336d79e..4aa3852 100644 --- a/yewprint-doc/src/app.rs +++ b/yewprint-doc/src/app.rs @@ -55,7 +55,7 @@ impl Component for App { fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::ToggleLight => { - DARK.with(|x| x.replace(!*x.borrow())); + DARK.with(|x| x.replace_with(|&mut x| !x)); } Msg::GoToMenu(event, doc_menu) => { event.prevent_default();