From c2e3a8242b32b862e4eb3fc46d1f7c1a73ac6b88 Mon Sep 17 00:00:00 2001 From: Michael Scofield Date: Tue, 17 Dec 2024 13:57:53 +0100 Subject: [PATCH] add conversion from ArcStore to Store --- reactive_stores/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reactive_stores/src/lib.rs b/reactive_stores/src/lib.rs index 92a780fdc9..5e2d37156d 100644 --- a/reactive_stores/src/lib.rs +++ b/reactive_stores/src/lib.rs @@ -569,6 +569,20 @@ where } } +impl From> for Store +where + T: 'static, + S: Storage>, +{ + fn from(value: ArcStore) -> Self { + Self { + #[cfg(debug_assertions)] + defined_at: value.defined_at, + inner: ArenaItem::new_with_storage(value), + } + } +} + #[cfg(test)] mod tests { use crate::{self as reactive_stores, Patch, Store, StoreFieldIterator};