mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
cargo fmt
This commit is contained in:
@@ -101,10 +101,7 @@ impl Module {
|
||||
pub fn new(store: &Store, bytes: impl AsRef<[u8]>) -> Result<Self, CompileError> {
|
||||
#[cfg(feature = "wat")]
|
||||
let bytes = wat::parse_bytes(bytes.as_ref()).map_err(|e| {
|
||||
CompileError::Wasm(WasmError::Generic(format!(
|
||||
"Error when converting wat: {}",
|
||||
e
|
||||
)))
|
||||
CompileError::Wasm(WasmError::Generic(format!("Error when converting wat: {}", e)))
|
||||
})?;
|
||||
|
||||
Self::from_binary(store, bytes.as_ref())
|
||||
@@ -253,10 +250,7 @@ impl Module {
|
||||
}
|
||||
|
||||
fn from_artifact(store: &Store, artifact: Arc<dyn Artifact>) -> Self {
|
||||
Self {
|
||||
store: store.clone(),
|
||||
artifact,
|
||||
}
|
||||
Self { store: store.clone(), artifact }
|
||||
}
|
||||
|
||||
pub(crate) fn instantiate(
|
||||
@@ -265,8 +259,7 @@ impl Module {
|
||||
) -> Result<InstanceHandle, InstantiationError> {
|
||||
unsafe {
|
||||
let instance_handle =
|
||||
self.artifact
|
||||
.instantiate(self.store.tunables(), resolver, Box::new(()))?;
|
||||
self.artifact.instantiate(self.store.tunables(), resolver, Box::new(()))?;
|
||||
|
||||
// After the instance handle is created, we need to initialize
|
||||
// the data, call the start function and so. However, if any
|
||||
@@ -425,8 +418,6 @@ impl Module {
|
||||
|
||||
impl fmt::Debug for Module {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Module")
|
||||
.field("name", &self.name())
|
||||
.finish()
|
||||
f.debug_struct("Module").field("name", &self.name()).finish()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user