simplify generational box by compressing debug info

This commit is contained in:
Jonathan Kelley committed 2024-01-22 21:17:02 -08:00
1 parent 27f8377ea5
commit 079fec3be6
7 files changed
+162 -163

No files matched your search

+2 -2
View File
@@ -22,8 +22,8 @@ pub use dependency::*;
mod map;
pub use map::*;
mod comparer;
pub use comparer::*;
// mod comparer;
// pub use comparer::*;
mod global;
pub use global::*;
+6 -2
View File
@@ -14,10 +14,14 @@ pub struct MappedSignal<U: 'static + ?Sized> {
impl MappedSignal<()> {
/// Create a new mapped signal.
pub fn new<T, S: Storage<SignalData<T>>, U: ?Sized>(
pub fn new<T, S, U>(
signal: Signal<T, S>,
mapping: impl Fn(&T) -> &U + 'static,
) -> MappedSignal<S::Ref<U>> {
) -> MappedSignal<S::Ref<U>>
where
S: Storage<SignalData<T>>,
U: ?Sized,
{
MappedSignal {
origin_scope: signal.origin_scope(),
mapping: CopyValue::new(Box::new(move || S::map(signal.read(), &mapping))),