From cd3a27c1b8cfeded5e58a1049713b5f7494d2fce Mon Sep 17 00:00:00 2001 From: luoxiao Date: Mon, 29 Jan 2024 11:23:51 +0800 Subject: [PATCH] fix: model word --- thaw/src/utils/model.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/thaw/src/utils/model.rs b/thaw/src/utils/model.rs index 95411f5..1731161 100644 --- a/thaw/src/utils/model.rs +++ b/thaw/src/utils/model.rs @@ -158,9 +158,9 @@ impl From<(Memo, WriteSignal)> for Model { impl From<(Option, WriteSignal)> for Model { fn from((read, write): (Option, WriteSignal)) -> Self { - let mut modal = Self::new(read.unwrap_or_default()); - modal.on_write = Some(write.into()); - modal + let mut model = Self::new(read.unwrap_or_default()); + model.on_write = Some(write.into()); + model } } @@ -174,24 +174,24 @@ mod test { let runtime = create_runtime(); // T - let modal: Model = 0.into(); - assert_eq!(modal.get_untracked(), 0); - modal.set(1); - assert_eq!(modal.get_untracked(), 1); + let model: Model = 0.into(); + assert_eq!(model.get_untracked(), 0); + model.set(1); + assert_eq!(model.get_untracked(), 1); // RwSignal let rw_signal = RwSignal::new(0); - let modal: Model = rw_signal.into(); - assert_eq!(modal.get_untracked(), 0); - modal.set(1); - assert_eq!(modal.get_untracked(), 1); + let model: Model = rw_signal.into(); + assert_eq!(model.get_untracked(), 0); + model.set(1); + assert_eq!(model.get_untracked(), 1); // Read Write let (read, write) = create_signal(0); - let modal: Model = (read, write).into(); - assert_eq!(modal.get_untracked(), 0); - modal.set(1); - assert_eq!(modal.get_untracked(), 1); + let model: Model = (read, write).into(); + assert_eq!(model.get_untracked(), 0); + model.set(1); + assert_eq!(model.get_untracked(), 1); runtime.dispose(); }