feat(napi): make Error::from_reason() generic
This commit is contained in:
parent
8681cadc0f
commit
f301581445
2 changed files with 3 additions and 3 deletions
examples/napi-compat-mode/src
|
@ -58,7 +58,7 @@ impl Task for CountBufferLength {
|
|||
|
||||
fn compute(&mut self) -> Result<Self::Output> {
|
||||
if self.data.len() == 10 {
|
||||
return Err(Error::from_reason("len can't be 5".to_string()));
|
||||
return Err(Error::from_reason("len can't be 5"));
|
||||
}
|
||||
Ok(self.data.len())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue