diff --git a/napi/src/task.rs b/napi/src/task.rs index 3951a403..7ff0ffb8 100644 --- a/napi/src/task.rs +++ b/napi/src/task.rs @@ -4,7 +4,7 @@ pub trait Task { type Output: Send + Sized + 'static; type JsValue: ValueType; - fn compute(&self) -> Result; + fn compute(&mut self) -> Result; fn resolve(&self, env: &mut Env, output: Self::Output) -> Result>; } diff --git a/test_module/src/lib.rs b/test_module/src/lib.rs index 12766e82..8b690273 100644 --- a/test_module/src/lib.rs +++ b/test_module/src/lib.rs @@ -51,7 +51,7 @@ impl Task for ComputeFib { type Output = u32; type JsValue = Number; - fn compute(&self) -> Result { + fn compute(&mut self) -> Result { Ok(fibonacci_native(self.n)) }