refactor(napi): self in Task::compute could be mutable
This commit is contained in:
parent
79401d693e
commit
17cb852a6e
2 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ pub trait Task {
|
||||||
type Output: Send + Sized + 'static;
|
type Output: Send + Sized + 'static;
|
||||||
type JsValue: ValueType;
|
type JsValue: ValueType;
|
||||||
|
|
||||||
fn compute(&self) -> Result<Self::Output>;
|
fn compute(&mut self) -> Result<Self::Output>;
|
||||||
|
|
||||||
fn resolve(&self, env: &mut Env, output: Self::Output) -> Result<Value<Self::JsValue>>;
|
fn resolve(&self, env: &mut Env, output: Self::Output) -> Result<Value<Self::JsValue>>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ impl Task for ComputeFib {
|
||||||
type Output = u32;
|
type Output = u32;
|
||||||
type JsValue = Number;
|
type JsValue = Number;
|
||||||
|
|
||||||
fn compute(&self) -> Result<Self::Output> {
|
fn compute(&mut self) -> Result<Self::Output> {
|
||||||
Ok(fibonacci_native(self.n))
|
Ok(fibonacci_native(self.n))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue