diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-06-30 19:19:45 +0200 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-06-30 19:19:45 +0200 |
| commit | 9c85fa9c3a2066ce851af53d7019e6a25a45af3b (patch) | |
| tree | 79e6608e97f08c0ebdb64125b0c658f5cc4bb33f /crates/parser | |
| parent | 7e8770cc4e418ef1a8cdfd9b1f59ee14b07cc6c9 (diff) | |
chore: restructure runtime and reduce build dependencies
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser')
| -rw-r--r-- | crates/parser/Cargo.toml | 4 | ||||
| -rw-r--r-- | crates/parser/src/lib.rs | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index 89d2b71..994bd6d 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -10,8 +10,8 @@ rust-version.workspace=true [dependencies] wasmparser={version="0.212", default-features=false, features=["validate"]} -log={version="0.4", optional=true} -tinywasm-types={version="0.7.0", path="../types", default-features=false} +log={workspace=true, optional=true} +tinywasm-types={version="0.8.0-alpha.0", path="../types", default-features=false} [features] default=["std", "logging"] diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 8ea5a86..77349b2 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -5,7 +5,6 @@ ))] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub)] #![forbid(unsafe_code)] -#![cfg_attr(not(feature = "std"), feature(error_in_core))] //! See [`tinywasm`](https://docs.rs/tinywasm) for documentation. extern crate alloc; @@ -15,23 +14,25 @@ extern crate std; // log for logging (optional). #[cfg(feature = "logging")] -#[allow(clippy::single_component_path_imports)] +#[allow(clippy::single_component_path_imports, unused_imports)] use log; // noop fallback if logging is disabled. #[cfg(not(feature = "logging"))] -mod log { +#[allow(unused_imports, unused_macros)] +pub(crate) mod log { macro_rules! debug ( ($($tt:tt)*) => {{}} ); + macro_rules! info ( ($($tt:tt)*) => {{}} ); macro_rules! error ( ($($tt:tt)*) => {{}} ); pub(crate) use debug; pub(crate) use error; + pub(crate) use info; } mod conversion; mod error; mod module; mod visit; -use alloc::vec::Vec; pub use error::*; use module::ModuleReader; use wasmparser::{Validator, WasmFeaturesInflated}; @@ -114,7 +115,7 @@ impl Parser { let mut validator = self.create_validator(); let mut reader = ModuleReader::new(); - let mut buffer = Vec::new(); + let mut buffer = alloc::vec::Vec::new(); let mut parser = wasmparser::Parser::new(0); let mut eof = false; |
