[oden-js] Promise completion should be FnOnce
This commit is contained in:
parent
3b2af4bb14
commit
44c39b1740
1 changed files with 3 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ impl PromiseHandle {
|
|||
}
|
||||
}
|
||||
|
||||
pub type PromiseResult = Box<dyn Fn(&ContextRef) -> ValueResult + Send + 'static>;
|
||||
pub type PromiseResult = Box<dyn FnOnce(&ContextRef) -> ValueResult + Send + 'static>;
|
||||
|
||||
pub(crate) enum PromiseEvent {
|
||||
Resolved(PromiseResult),
|
||||
|
|
@ -48,7 +48,7 @@ impl Promise {
|
|||
|
||||
pub fn resolve<T>(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<T>(mut self, value: T)
|
||||
where
|
||||
T: Fn(&ContextRef) -> ValueResult + Send + 'static,
|
||||
T: FnOnce(&ContextRef) -> ValueResult + Send + 'static,
|
||||
{
|
||||
let _ = self
|
||||
.channel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue