summaryrefslogtreecommitdiffstats
path: root/native/src/widget/action.rs
diff options
context:
space:
mode:
authorLibravatar 无限UCW <x-wuxian@qq.com>2022-08-12 01:57:05 +0800
committerLibravatar 无限UCW <x-wuxian@qq.com>2022-08-12 01:57:05 +0800
commitf21d1209aa576a3e597c100fa56afe554dc2babd (patch)
tree3b5ebd93ceff1d6d3b7c62dc5eba44dacbf17fff /native/src/widget/action.rs
parente209349c508fe67d4494cd512eb25899840a13fd (diff)
downloadiced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.gz
iced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.bz2
iced-f21d1209aa576a3e597c100fa56afe554dc2babd.zip
Relax `Fn` trait bounds in `Command` & `Action`
Diffstat (limited to '')
-rw-r--r--native/src/widget/action.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/native/src/widget/action.rs b/native/src/widget/action.rs
index 766e902b..ea1d9b12 100644
--- a/native/src/widget/action.rs
+++ b/native/src/widget/action.rs
@@ -16,7 +16,7 @@ impl<T> Action<T> {
/// Maps the output of an [`Action`] using the given function.
pub fn map<A>(
self,
- f: impl Fn(T) -> A + 'static + MaybeSend + Sync,
+ f: impl FnMut(T) -> A + 'static + MaybeSend + Sync,
) -> Action<A>
where
T: 'static,
@@ -37,7 +37,7 @@ impl<T> Action<T> {
#[allow(missing_debug_implementations)]
struct Map<A, B> {
operation: Box<dyn Operation<A>>,
- f: Box<dyn Fn(A) -> B>,
+ f: Box<dyn FnMut(A) -> B>,
}
impl<A, B> Operation<B> for Map<A, B>
@@ -52,7 +52,7 @@ where
) {
struct MapRef<'a, A, B> {
operation: &'a mut dyn Operation<A>,
- f: &'a dyn Fn(A) -> B,
+ f: &'a mut dyn FnMut(A) -> B,
}
impl<'a, A, B> Operation<B> for MapRef<'a, A, B> {