From f21d1209aa576a3e597c100fa56afe554dc2babd Mon Sep 17 00:00:00 2001 From: 无限UCW Date: Fri, 12 Aug 2022 01:57:05 +0800 Subject: Relax `Fn` trait bounds in `Command` & `Action` --- native/src/system/action.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'native/src/system/action.rs') 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 { QueryInformation(Box>), } -pub trait Closure: Fn(system::Information) -> T + MaybeSend {} +pub trait Closure: FnOnce(system::Information) -> T + MaybeSend {} -impl Closure for T where T: Fn(system::Information) -> O + MaybeSend {} +impl Closure for T where T: FnOnce(system::Information) -> O + MaybeSend {} impl Action { /// Maps the output of a system [`Action`] using the provided closure. pub fn map( self, - f: impl Fn(T) -> A + 'static + MaybeSend + Sync, + f: impl FnOnce(T) -> A + 'static + MaybeSend + Sync, ) -> Action where T: 'static, -- cgit