diff --git a/reactive_stores/src/subfield.rs b/reactive_stores/src/subfield.rs index d1a496950..01f56c46c 100644 --- a/reactive_stores/src/subfield.rs +++ b/reactive_stores/src/subfield.rs @@ -80,7 +80,7 @@ where { type Value = T; type Reader = Mapped; - type Writer = MappedMut, T>; + type Writer = MappedMut, T>; type UntrackedWriter = MappedMut, T>; @@ -102,14 +102,14 @@ where fn writer(&self) -> Option { let trigger = self.get_trigger(self.path().into_iter().collect()); - let inner = WriteGuard::new(trigger, self.inner.untracked_writer()?); + let inner = WriteGuard::new(trigger, self.inner.writer()?); Some(MappedMut::new(inner, self.read, self.write)) } fn untracked_writer(&self) -> Option { - let mut guard = self.writer()?; - guard.untrack(); - Some(guard) + let trigger = self.get_trigger(self.path().into_iter().collect()); + let inner = WriteGuard::new(trigger, self.inner.untracked_writer()?); + Some(MappedMut::new(inner, self.read, self.write)) } }