Skip to content

Commit

Permalink
add conversion from ArcStore to Store
Browse files Browse the repository at this point in the history
  • Loading branch information
mscofield0 committed Dec 17, 2024
1 parent 1b8ad58 commit c2e3a82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions reactive_stores/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,20 @@ where
}
}

impl<T, S> From<ArcStore<T>> for Store<T, S>
where
T: 'static,
S: Storage<ArcStore<T>>,
{
fn from(value: ArcStore<T>) -> 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};
Expand Down

0 comments on commit c2e3a82

Please sign in to comment.