Make automatically the trait Into<Engine> conversions

This commit is contained in:
Syrus Akbary
2023-02-27 23:25:17 -08:00
parent fe72a5ab7f
commit 09427c3bb6
4 changed files with 6 additions and 27 deletions

View File

@@ -42,22 +42,12 @@ impl Default for Engine {
}
}
impl From<engine_imp::Engine> for Engine {
fn from(inner: engine_imp::Engine) -> Self {
Self(inner)
impl<T: Into<engine_imp::Engine>> From<T> for Engine {
fn from(t: T) -> Self {
Self(t.into())
}
}
// impl<P> Into<Engine> for P
// where
// P: Into<engine_imp::Engine>
// {
// fn into(self) -> Engine {
// let inner_engine: engine_imp::Engine = self.into();
// Engine(inner_engine)
// }
// }
/// A temporary handle to an [`Engine`]
/// EngineRef can be used to build a [`Module`][wasmer::Module]
/// It can be created directly with an [`Engine`]

View File

@@ -51,18 +51,6 @@ pub(crate) fn default_engine() -> Engine {
engine
}
impl From<EngineBuilder> for crate::engine::Engine {
fn from(builder: EngineBuilder) -> Self {
Self(builder.into())
}
}
// impl From<CompilerConfig> for crate::engine::Engine {
// fn from(compiler: CompilerConfig) -> Self {
// Self(compiler.into())
// }
// }
/// The custom trait to access to all the `sys` function in the common
/// engine.
pub trait NativeEngineExt {