summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock118
-rw-r--r--Cargo.toml9
-rw-r--r--crates/parser/Cargo.toml2
-rw-r--r--crates/parser/src/conversion.rs4
-rw-r--r--crates/parser/src/lib.rs2
-rw-r--r--crates/parser/src/module.rs2
-rw-r--r--crates/parser/src/visit.rs4
-rw-r--r--crates/tinywasm/Cargo.toml2
-rw-r--r--crates/tinywasm/benches/argon2id.rs4
-rw-r--r--crates/tinywasm/benches/fibonacci.rs7
-rw-r--r--crates/tinywasm/benches/tinywasm.rs6
-rw-r--r--crates/tinywasm/src/error.rs2
-rw-r--r--crates/tinywasm/src/func.rs2
-rw-r--r--crates/tinywasm/src/imports.rs6
-rw-r--r--crates/tinywasm/src/interpreter/stack/call_stack.rs4
-rw-r--r--crates/tinywasm/src/interpreter/stack/value_stack.rs2
-rw-r--r--crates/tinywasm/src/store/memory.rs2
-rw-r--r--crates/tinywasm/src/store/mod.rs2
-rw-r--r--crates/types/src/archive.rs4
19 files changed, 71 insertions, 113 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ccb8fa3..1178a8a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -114,18 +114,18 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.29"
+version = "4.5.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184"
+checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
-version = "4.5.29"
+version = "4.5.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9"
+checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863"
dependencies = [
"anstyle",
"clap_lex",
@@ -211,9 +211,9 @@ checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
[[package]]
name = "either"
-version = "1.13.0"
+version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
+checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d"
[[package]]
name = "embedded-io"
@@ -242,9 +242,9 @@ dependencies = [
[[package]]
name = "equivalent"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "eyre"
@@ -346,12 +346,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
-name = "leb128"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
-
-[[package]]
name = "leb128fmt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -359,9 +353,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "libc"
-version = "0.2.169"
+version = "0.2.170"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
+checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
[[package]]
name = "libm"
@@ -371,9 +365,9 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
[[package]]
name = "log"
-version = "0.4.25"
+version = "0.4.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
+checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
[[package]]
name = "memchr"
@@ -404,9 +398,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9"
[[package]]
name = "owo-colors"
-version = "4.1.0"
+version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56"
+checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564"
[[package]]
name = "postcard"
@@ -526,18 +520,18 @@ checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03"
[[package]]
name = "serde"
-version = "1.0.217"
+version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
+checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.217"
+version = "1.0.218"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
+checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b"
dependencies = [
"proc-macro2",
"quote",
@@ -546,9 +540,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.138"
+version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949"
+checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6"
dependencies = [
"itoa",
"memchr",
@@ -602,7 +596,7 @@ dependencies = [
"tinywasm-parser",
"tinywasm-types",
"wasm-testsuite",
- "wast 225.0.0",
+ "wast",
"wat",
]
@@ -615,7 +609,7 @@ dependencies = [
"log",
"pretty_env_logger",
"tinywasm",
- "wast 225.0.0",
+ "wast",
]
[[package]]
@@ -624,7 +618,7 @@ version = "0.9.0-alpha.0"
dependencies = [
"log",
"tinywasm-types",
- "wasmparser 0.225.0",
+ "wasmparser",
]
[[package]]
@@ -648,9 +642,9 @@ dependencies = [
[[package]]
name = "unicode-ident"
-version = "1.0.16"
+version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
+checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe"
[[package]]
name = "unicode-width"
@@ -670,39 +664,29 @@ dependencies = [
[[package]]
name = "wasm-encoder"
-version = "0.224.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ab7a13a23790fe91ea4eb7526a1f3131001d874e3e00c2976c48861f2e82920"
-dependencies = [
- "leb128",
- "wasmparser 0.224.1",
-]
-
-[[package]]
-name = "wasm-encoder"
-version = "0.225.0"
+version = "0.226.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f7eac0445cac73bcf09e6a97f83248d64356dccf9f2b100199769b6b42464e5"
+checksum = "f7d81b727619aec227dce83e7f7420d4e56c79acd044642a356ea045b98d4e13"
dependencies = [
"leb128fmt",
- "wasmparser 0.225.0",
+ "wasmparser",
]
[[package]]
name = "wasm-testsuite"
-version = "0.4.2"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a4e25e8fd04d2da04479453bb74448dfffb960c5a0ed74df97a4cdddcaab85c"
+checksum = "fea6edc2d1ffad1d673091e3e3e98961e7c1a8c0f24cbf2431fa02d861e071bd"
dependencies = [
"include_dir",
- "wast 224.0.1",
+ "wast",
]
[[package]]
name = "wasmparser"
-version = "0.224.1"
+version = "0.226.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04f17a5917c2ddd3819e84c661fae0d6ba29d7b9c1f0e96c708c65a9c4188e11"
+checksum = "bc28600dcb2ba68d7e5f1c3ba4195c2bddc918c0243fd702d0b6dbd05689b681"
dependencies = [
"bitflags",
"indexmap",
@@ -710,49 +694,25 @@ dependencies = [
]
[[package]]
-name = "wasmparser"
-version = "0.225.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36e5456165f81e64cb9908a0fe9b9d852c2c74582aa3fe2be3c2da57f937d3ae"
-dependencies = [
- "bitflags",
- "indexmap",
- "semver",
-]
-
-[[package]]
-name = "wast"
-version = "224.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddf8e902015ff670011613811be3310408d2dba911217eea711aa98c89584aca"
-dependencies = [
- "bumpalo",
- "leb128",
- "memchr",
- "unicode-width",
- "wasm-encoder 0.224.1",
-]
-
-[[package]]
name = "wast"
-version = "225.0.0"
+version = "226.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61496027ff707f9fa9e0b22c34ec163eb7adb1070df565e32a9180a76e4300b"
+checksum = "0bb903956d0151eabb6c30a2304dd61e5c8d7182805226120c2b6d611fb09a26"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width",
- "wasm-encoder 0.225.0",
+ "wasm-encoder",
]
[[package]]
name = "wat"
-version = "1.225.0"
+version = "1.226.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89e72a33942234fd0794bcdac30e43b448de3187512414267678e511c6755f11"
+checksum = "5f89a90ef2c401b8b5b2b704020bfa7a7f69b93c3034c7a4b4a88e21e9966581"
dependencies = [
- "wast 225.0.0",
+ "wast",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index e92c4ad..e433260 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,8 +4,9 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
resolver="2"
[workspace.dependencies]
-wast="225"
-wat="1.225"
+wast="226"
+wat="1.226"
+wasmparser={version="0.226", default-features=false}
eyre="0.6"
log="0.4"
pretty_env_logger="0.5"
@@ -13,8 +14,8 @@ criterion={version="0.5", default-features=false, features=["cargo_bench_support
[workspace.package]
version="0.9.0-alpha.0"
-rust-version="1.81"
-edition="2021"
+rust-version="1.85"
+edition="2024"
license="MIT OR Apache-2.0"
authors=["Henry Gressmann <mail@henrygressmann.de>"]
repository="https://github.com/explodingcamera/tinywasm"
diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml
index fec21b3..7bd9cad 100644
--- a/crates/parser/Cargo.toml
+++ b/crates/parser/Cargo.toml
@@ -9,7 +9,7 @@ repository.workspace=true
rust-version.workspace=true
[dependencies]
-wasmparser={version="0.225", default-features=false, features=["validate", "features", "simd"]}
+wasmparser={workspace=true, features=["validate", "features", "simd"]}
log={workspace=true, optional=true}
tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false}
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs
index 273dd44..86548d6 100644
--- a/crates/parser/src/conversion.rs
+++ b/crates/parser/src/conversion.rs
@@ -92,7 +92,7 @@ pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result<Im
ImportKind::Global(GlobalType { mutable: ty.mutable, ty: convert_valtype(&ty.content_type) })
}
wasmparser::TypeRef::Tag(ty) => {
- return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}")))
+ return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}")));
}
},
})
@@ -157,7 +157,7 @@ pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Ex
wasmparser::ExternalKind::Memory => ExternalKind::Memory,
wasmparser::ExternalKind::Global => ExternalKind::Global,
wasmparser::ExternalKind::Tag => {
- return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported export kind: {:?}", export.kind)))
+ return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported export kind: {:?}", export.kind)));
}
};
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index 04da9da..e5022c5 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -72,14 +72,12 @@ impl Parser {
component_model: false,
component_model_nested_names: false,
component_model_values: false,
- component_model_more_flags: false,
exceptions: false,
gc: false,
memory_control: false,
relaxed_simd: false,
threads: false,
shared_everything_threads: false,
- component_model_multiple_returns: false,
legacy_exceptions: false,
component_model_async: false,
};
diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs
index 9b31f9e..ff6b22b 100644
--- a/crates/parser/src/module.rs
+++ b/crates/parser/src/module.rs
@@ -1,5 +1,5 @@
use crate::log::debug;
-use crate::{conversion, ParseError, Result};
+use crate::{ParseError, Result, conversion};
use alloc::string::ToString;
use alloc::{boxed::Box, format, vec::Vec};
use tinywasm_types::{
diff --git a/crates/parser/src/visit.rs b/crates/parser/src/visit.rs
index 89c27d1..2830d3a 100644
--- a/crates/parser/src/visit.rs
+++ b/crates/parser/src/visit.rs
@@ -531,11 +531,11 @@ impl<R: WasmModuleResources> wasmparser::VisitSimdOperator<'_> for FunctionBuild
fn visit_i8x16_shuffle(&mut self, lanes: [u8; 16]) -> Self::Output {
self.v128_constants.push(u128::from_le_bytes(lanes));
- self.instructions.push(Instruction::I8x16Shuffle(self.v128_constants.len() as u32 - 1).into());
+ self.instructions.push(Instruction::I8x16Shuffle(self.v128_constants.len() as u32 - 1));
}
fn visit_v128_const(&mut self, value: wasmparser::V128) -> Self::Output {
self.v128_constants.push(value.i128() as u128);
- self.instructions.push(Instruction::V128Const(self.v128_constants.len() as u32 - 1).into());
+ self.instructions.push(Instruction::V128Const(self.v128_constants.len() as u32 - 1));
}
}
diff --git a/crates/tinywasm/Cargo.toml b/crates/tinywasm/Cargo.toml
index 0623f35..2cad2e4 100644
--- a/crates/tinywasm/Cargo.toml
+++ b/crates/tinywasm/Cargo.toml
@@ -20,7 +20,7 @@ tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false
libm={version="0.2", default-features=false}
[dev-dependencies]
-wasm-testsuite={version="0.4.2"}
+wasm-testsuite={version="0.4.4"}
indexmap="2.7"
wast={workspace=true}
wat={workspace=true}
diff --git a/crates/tinywasm/benches/argon2id.rs b/crates/tinywasm/benches/argon2id.rs
index d977352..aa8b38b 100644
--- a/crates/tinywasm/benches/argon2id.rs
+++ b/crates/tinywasm/benches/argon2id.rs
@@ -1,6 +1,6 @@
-use criterion::{criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, criterion_group, criterion_main};
use eyre::Result;
-use tinywasm::{types, ModuleInstance, Store};
+use tinywasm::{ModuleInstance, Store, types};
use types::TinyWasmModule;
const WASM: &[u8] = include_bytes!("../../../examples/rust/out/argon2id.opt.wasm");
diff --git a/crates/tinywasm/benches/fibonacci.rs b/crates/tinywasm/benches/fibonacci.rs
index dcf6eb9..a5f1c72 100644
--- a/crates/tinywasm/benches/fibonacci.rs
+++ b/crates/tinywasm/benches/fibonacci.rs
@@ -1,6 +1,6 @@
-use criterion::{criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, criterion_group, criterion_main};
use eyre::Result;
-use tinywasm::{types, ModuleInstance, Store};
+use tinywasm::{ModuleInstance, Store, types};
use types::TinyWasmModule;
const WASM: &[u8] = include_bytes!("../../../examples/rust/out/fibonacci.opt.wasm");
@@ -17,8 +17,7 @@ fn fibonacci_to_twasm(module: &TinyWasmModule) -> Result<Vec<u8>> {
}
fn fibonacci_from_twasm(twasm: &[u8]) -> Result<TinyWasmModule> {
- let module = TinyWasmModule::from_twasm(&twasm)?;
- Ok(module)
+ Ok(TinyWasmModule::from_twasm(twasm)?)
}
fn fibonacci_run(module: TinyWasmModule, recursive: bool, n: i32) -> Result<()> {
diff --git a/crates/tinywasm/benches/tinywasm.rs b/crates/tinywasm/benches/tinywasm.rs
index 8552d6c..4848a4a 100644
--- a/crates/tinywasm/benches/tinywasm.rs
+++ b/crates/tinywasm/benches/tinywasm.rs
@@ -1,6 +1,6 @@
-use criterion::{criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, criterion_group, criterion_main};
use eyre::Result;
-use tinywasm::{types, Extern, FuncContext, Imports, ModuleInstance, Store};
+use tinywasm::{Extern, FuncContext, Imports, ModuleInstance, Store, types};
use types::TinyWasmModule;
const WASM: &[u8] = include_bytes!("../../../examples/rust/out/tinywasm.opt.wasm");
@@ -17,7 +17,7 @@ fn tinywasm_to_twasm(module: &TinyWasmModule) -> Result<Vec<u8>> {
}
fn tinywasm_from_twasm(twasm: &[u8]) -> Result<TinyWasmModule> {
- let module = TinyWasmModule::from_twasm(&twasm)?;
+ let module = TinyWasmModule::from_twasm(twasm)?;
Ok(module)
}
diff --git a/crates/tinywasm/src/error.rs b/crates/tinywasm/src/error.rs
index 1d488d8..9637521 100644
--- a/crates/tinywasm/src/error.rs
+++ b/crates/tinywasm/src/error.rs
@@ -1,8 +1,8 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::{fmt::Display, ops::ControlFlow};
-use tinywasm_types::archive::TwasmError;
use tinywasm_types::FuncType;
+use tinywasm_types::archive::TwasmError;
#[cfg(feature = "parser")]
pub use tinywasm_parser::ParseError;
diff --git a/crates/tinywasm/src/func.rs b/crates/tinywasm/src/func.rs
index f5a9873..2eeabca 100644
--- a/crates/tinywasm/src/func.rs
+++ b/crates/tinywasm/src/func.rs
@@ -1,6 +1,6 @@
use crate::interpreter::stack::{CallFrame, Stack};
-use crate::{log, unlikely, Function};
use crate::{Error, FuncContext, Result, Store};
+use crate::{Function, log, unlikely};
use alloc::{boxed::Box, format, string::String, string::ToString, vec, vec::Vec};
use tinywasm_types::{ExternRef, FuncRef, FuncType, ModuleInstanceAddr, ValType, WasmValue};
diff --git a/crates/tinywasm/src/imports.rs b/crates/tinywasm/src/imports.rs
index 0797470..12876c8 100644
--- a/crates/tinywasm/src/imports.rs
+++ b/crates/tinywasm/src/imports.rs
@@ -6,7 +6,7 @@ use alloc::vec::Vec;
use core::fmt::Debug;
use crate::func::{FromWasmValueTuple, IntoWasmValueTuple, ValTypesFromTuple};
-use crate::{log, LinkingError, MemoryRef, MemoryRefMut, Result};
+use crate::{LinkingError, MemoryRef, MemoryRefMut, Result, log};
use tinywasm_types::*;
/// The internal representation of a function
@@ -322,7 +322,7 @@ impl Imports {
match (expected.size_max, actual.size_max) {
(None, Some(_)) => return Err(LinkingError::incompatible_import_type(import).into()),
(Some(expected_max), Some(actual_max)) if actual_max < expected_max => {
- return Err(LinkingError::incompatible_import_type(import).into())
+ return Err(LinkingError::incompatible_import_type(import).into());
}
_ => {}
}
@@ -339,7 +339,7 @@ impl Imports {
Self::compare_types(import, &expected.arch(), &actual.arch())?;
if actual.page_count_initial() > expected.page_count_initial()
- && real_size.map_or(true, |size| actual.page_count_initial() > size as u64)
+ && real_size.is_none_or(|size| actual.page_count_initial() > size as u64)
{
return Err(LinkingError::incompatible_import_type(import).into());
}
diff --git a/crates/tinywasm/src/interpreter/stack/call_stack.rs b/crates/tinywasm/src/interpreter/stack/call_stack.rs
index f0e8d18..9b6c3fd 100644
--- a/crates/tinywasm/src/interpreter/stack/call_stack.rs
+++ b/crates/tinywasm/src/interpreter/stack/call_stack.rs
@@ -1,9 +1,9 @@
use core::ops::ControlFlow;
use super::BlockType;
-use crate::interpreter::values::*;
use crate::Trap;
-use crate::{unlikely, Error};
+use crate::interpreter::values::*;
+use crate::{Error, unlikely};
use alloc::boxed::Box;
use alloc::{rc::Rc, vec, vec::Vec};
diff --git a/crates/tinywasm/src/interpreter/stack/value_stack.rs b/crates/tinywasm/src/interpreter/stack/value_stack.rs
index ea6a082..9830c01 100644
--- a/crates/tinywasm/src/interpreter/stack/value_stack.rs
+++ b/crates/tinywasm/src/interpreter/stack/value_stack.rs
@@ -1,7 +1,7 @@
use alloc::vec::Vec;
use tinywasm_types::{ExternRef, FuncRef, ValType, ValueCounts, ValueCountsSmall, WasmValue};
-use crate::{interpreter::*, Result};
+use crate::{Result, interpreter::*};
use super::Locals;
pub(crate) const STACK_32_SIZE: usize = 1024 * 32;
diff --git a/crates/tinywasm/src/store/memory.rs b/crates/tinywasm/src/store/memory.rs
index 4826b65..d204c67 100644
--- a/crates/tinywasm/src/store/memory.rs
+++ b/crates/tinywasm/src/store/memory.rs
@@ -2,7 +2,7 @@ use alloc::vec;
use alloc::vec::Vec;
use tinywasm_types::{MemoryType, ModuleInstanceAddr};
-use crate::{cold, log, Error, Result};
+use crate::{Error, Result, cold, log};
/// A WebAssembly Memory Instance
///
diff --git a/crates/tinywasm/src/store/mod.rs b/crates/tinywasm/src/store/mod.rs
index 86cbb5d..5730631 100644
--- a/crates/tinywasm/src/store/mod.rs
+++ b/crates/tinywasm/src/store/mod.rs
@@ -4,7 +4,7 @@ use core::sync::atomic::{AtomicUsize, Ordering};
use tinywasm_types::*;
use crate::interpreter::{self, InterpreterRuntime, TinyWasmValue};
-use crate::{cold, Error, Function, ModuleInstance, Result, Trap};
+use crate::{Error, Function, ModuleInstance, Result, Trap, cold};
mod data;
mod element;
diff --git a/crates/types/src/archive.rs b/crates/types/src/archive.rs
index a725e3d..cbc22ad 100644
--- a/crates/types/src/archive.rs
+++ b/crates/types/src/archive.rs
@@ -52,13 +52,13 @@ impl TinyWasmModule {
pub fn from_twasm(wasm: &[u8]) -> Result<TinyWasmModule, TwasmError> {
let len = validate_magic(wasm)?;
- postcard::from_bytes(&wasm[len..]).map_err(|e| TwasmError::InvalidArchive(e))
+ postcard::from_bytes(&wasm[len..]).map_err(TwasmError::InvalidArchive)
}
/// Serializes the `TinyWasmModule` into a vector of bytes.
pub fn serialize_twasm(&self) -> Result<Vec<u8>, TwasmError> {
let buf = Vec::from(TWASM_MAGIC);
- postcard::to_extend(self, buf).map_err(|e| TwasmError::InvalidArchive(e))
+ postcard::to_extend(self, buf).map_err(TwasmError::InvalidArchive)
}
}