diff --git a/src/error.rs b/src/error.rs index 83d7fb4..349d727 100644 --- a/src/error.rs +++ b/src/error.rs @@ -174,10 +174,7 @@ pub enum Error { /// Returning `Err(ExternalError(...))` from a Rust callback will raise the error as a Lua /// error. The Rust code that originally invoked the Lua code then receives a `CallbackError`, /// from which the original error (and a stack traceback) can be recovered. - #[cfg(feature = "send")] ExternalError(Arc), - #[cfg(not(feature = "send"))] - ExternalError(Arc), } /// A specialized `Result` type used by `mlua`'s API. @@ -277,35 +274,21 @@ impl StdError for Error { } impl Error { - #[cfg(feature = "send")] pub fn external>>(err: T) -> Error { Error::ExternalError(err.into().into()) } - - #[cfg(not(feature = "send"))] - pub fn external>>(err: T) -> Error { - Error::ExternalError(err.into().into()) - } } pub trait ExternalError { fn to_lua_err(self) -> Error; } -#[cfg(feature = "send")] impl>> ExternalError for E { fn to_lua_err(self) -> Error { Error::external(self) } } -#[cfg(not(feature = "send"))] -impl>> ExternalError for E { - fn to_lua_err(self) -> Error { - Error::external(self) - } -} - pub trait ExternalResult { fn to_lua_err(self) -> Result; }