diff options
author | 2022-08-12 01:57:05 +0800 | |
---|---|---|
committer | 2022-08-12 01:57:05 +0800 | |
commit | f21d1209aa576a3e597c100fa56afe554dc2babd (patch) | |
tree | 3b5ebd93ceff1d6d3b7c62dc5eba44dacbf17fff /native/src/system/action.rs | |
parent | e209349c508fe67d4494cd512eb25899840a13fd (diff) | |
download | iced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.gz iced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.bz2 iced-f21d1209aa576a3e597c100fa56afe554dc2babd.zip |
Relax `Fn` trait bounds in `Command` & `Action`
Diffstat (limited to 'native/src/system/action.rs')
-rw-r--r-- | native/src/system/action.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/native/src/system/action.rs b/native/src/system/action.rs index dea9536f..7f66141b 100644 --- a/native/src/system/action.rs +++ b/native/src/system/action.rs @@ -9,15 +9,15 @@ pub enum Action<T> { QueryInformation(Box<dyn Closure<T>>), } -pub trait Closure<T>: Fn(system::Information) -> T + MaybeSend {} +pub trait Closure<T>: FnOnce(system::Information) -> T + MaybeSend {} -impl<T, O> Closure<O> for T where T: Fn(system::Information) -> O + MaybeSend {} +impl<T, O> Closure<O> for T where T: FnOnce(system::Information) -> O + MaybeSend {} impl<T> Action<T> { /// Maps the output of a system [`Action`] using the provided closure. pub fn map<A>( self, - f: impl Fn(T) -> A + 'static + MaybeSend + Sync, + f: impl FnOnce(T) -> A + 'static + MaybeSend + Sync, ) -> Action<A> where T: 'static, |