From 44c39b174012ee6570e55aa41e34b2e8a4a79d4f Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 30 Jun 2023 05:52:32 -0700 Subject: [PATCH] [oden-js] Promise completion should be FnOnce --- oden-js/src/promise.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oden-js/src/promise.rs b/oden-js/src/promise.rs index 0bf846cc..8ee23b26 100644 --- a/oden-js/src/promise.rs +++ b/oden-js/src/promise.rs @@ -12,7 +12,7 @@ impl PromiseHandle { } } -pub type PromiseResult = Box ValueResult + Send + 'static>; +pub type PromiseResult = Box ValueResult + Send + 'static>; pub(crate) enum PromiseEvent { Resolved(PromiseResult), @@ -48,7 +48,7 @@ impl Promise { pub fn resolve(mut self, value: T) where - T: Fn(&ContextRef) -> ValueResult + Send + 'static, + T: FnOnce(&ContextRef) -> ValueResult + Send + 'static, { let _ = self .channel @@ -58,7 +58,7 @@ impl Promise { pub fn reject(mut self, value: T) where - T: Fn(&ContextRef) -> ValueResult + Send + 'static, + T: FnOnce(&ContextRef) -> ValueResult + Send + 'static, { let _ = self .channel