finish removing generic from SignalMap

This commit is contained in:
Evan Almloff committed 2023-10-17 13:50:21 -05:00
1 parent 4b8701e3eb
commit bfacf94db4
2 files changed
+16 -13

No files matched your search

+3 -3
View File
@@ -171,7 +171,7 @@ impl<T: 'static> Signal<T> {
/// Get the current value of the signal. This will subscribe the current scope to the signal.
/// If the signal has been dropped, this will panic.
pub fn read(&self) -> Ref<T> {
pub fn read(&self) -> Ref<'static, T> {
let inner = self.inner.read();
if let Some(effect) = Effect::current() {
let mut effect_subscribers = inner.effect_subscribers.borrow_mut();
@@ -200,7 +200,7 @@ impl<T: 'static> Signal<T> {
/// Get a mutable reference to the signal's value.
/// If the signal has been dropped, this will panic.
pub fn write(&self) -> Write<'_, T> {
pub fn write(&self) -> Write<'static, T> {
let inner = self.inner.write();
let borrow = RefMut::map(inner, |v| &mut v.value);
Write {
@@ -257,7 +257,7 @@ impl<T: 'static> Signal<T> {
}
/// Map the signal to a new type.
pub fn map<O>(self, f: fn(&T) -> &O) -> SignalMap<T, O> {
pub fn map<O>(self, f: fn(&T) -> &O) -> SignalMap<O> {
SignalMap::new(self, f)
}
}