File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -489,12 +489,12 @@ impl Storage {
489
489
fut. await . map ( |_| ( ) ) . map_err ( Error :: from)
490
490
}
491
491
492
- pub async fn transaction < F , Fut > ( & self , mut closure : F ) -> Result < ( ) >
492
+ pub async fn transaction < F , Fut > ( & self , closure : F ) -> Result < ( ) >
493
493
where
494
- F : FnMut ( Transaction ) -> Fut + Copy + ' static ,
494
+ F : FnOnce ( Transaction ) -> Fut + ' static ,
495
495
Fut : Future < Output = Result < ( ) > > + ' static ,
496
496
{
497
- let inner: Box < dyn FnMut ( DurableObjectTransaction ) -> js_sys:: Promise > =
497
+ let inner: Box < dyn FnOnce ( DurableObjectTransaction ) -> js_sys:: Promise > =
498
498
Box :: new ( move |t : DurableObjectTransaction | -> js_sys:: Promise {
499
499
future_to_promise ( async move {
500
500
closure ( Transaction { inner : t } )
@@ -503,7 +503,7 @@ impl Storage {
503
503
. map ( |_| JsValue :: NULL )
504
504
} )
505
505
} ) ;
506
- let clos = wasm_bindgen:: closure:: Closure :: wrap ( inner) ;
506
+ let clos = wasm_bindgen:: closure:: Closure :: once ( inner) ;
507
507
JsFuture :: from ( self . inner . transaction ( & clos) ?)
508
508
. await
509
509
. map_err ( Error :: from)
You can’t perform that action at this time.
0 commit comments