diff --git a/crates/oxc_linter/src/external_linter.rs b/crates/oxc_linter/src/external_linter.rs index d5c419f8ba1ef..284e5512a75c4 100644 --- a/crates/oxc_linter/src/external_linter.rs +++ b/crates/oxc_linter/src/external_linter.rs @@ -18,15 +18,8 @@ pub type ExternalLinterLoadPluginCb = Arc< + 'static, >; -pub type ExternalLinterLintFileCb = Arc< - dyn Fn( - String, - Vec, - &Allocator, - ) -> Result, Box> - + Sync - + Send, ->; +pub type ExternalLinterLintFileCb = + Arc, &Allocator) -> Result, String> + Sync + Send>; #[derive(Clone, Debug, Deserialize, Serialize)] pub enum PluginLoadResult { diff --git a/napi/oxlint2/src/lib.rs b/napi/oxlint2/src/lib.rs index c6a999527b8be..5ebac1b448ece 100644 --- a/napi/oxlint2/src/lib.rs +++ b/napi/oxlint2/src/lib.rs @@ -158,13 +158,13 @@ fn wrap_lint_file(cb: JsLintFileCb) -> ExternalLinterLintFileCb { ); if status != Status::Ok { - return Err(format!("Failed to schedule callback: {status:?}").into()); + return Err(format!("Failed to schedule callback: {status:?}")); } match rx.recv() { Ok(Ok(x)) => Ok(x), - Ok(Err(e)) => Err(format!("Callback reported error: {e}").into()), - Err(e) => Err(format!("Callback did not respond: {e}").into()), + Ok(Err(e)) => Err(format!("Callback reported error: {e}")), + Err(e) => Err(format!("Callback did not respond: {e}")), } }) }