add as_mapped_ref

This commit is contained in:
Evan Almloff committed 2024-01-01 10:44:21 -06:00
1 parent e45739ac04
commit b9d179c494
6 files changed
+68 -20

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
use crate::SignalMap;
use crate::MappedSignal;
use std::{
cell::RefCell,
mem::MaybeUninit,
@@ -307,8 +307,8 @@ impl<T: 'static> Signal<T> {
}
/// Map the signal to a new type.
pub fn map<O>(self, f: impl Fn(&T) -> &O + 'static) -> SignalMap<O> {
SignalMap::new(self, f)
pub fn map<O>(self, f: impl Fn(&T) -> &O + 'static) -> MappedSignal<O> {
MappedSignal::new(self, f)
}
}