Make the function bounds for map less restrictive
This commit is contained in:
1 parent
bfacf94db4
commit
a2fadc8d11
3 files changed
+30
-2
No files matched your search
@@ -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<O> {
|
||||
pub fn map<O>(self, f: impl Fn(&T) -> &O + 'static) -> SignalMap<O> {
|
||||
SignalMap::new(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user