diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-29 22:38:06 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-29 22:38:06 +0100 |
| commit | 963ddd26a89490458e31d9d553dffafe5e350e96 (patch) | |
| tree | 7a23b0d135e004667f9e0154e89a6ec31b225ff1 /crates/parser | |
| parent | f8651619e576ac97209b72660144568b54eb965c (diff) | |
chore: add more examples, refactoring
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser')
| -rw-r--r-- | crates/parser/README.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/parser/README.md b/crates/parser/README.md index 6cf2234..8ac7a30 100644 --- a/crates/parser/README.md +++ b/crates/parser/README.md @@ -1,6 +1,6 @@ # `tinywasm-parser` -This crate provides a parser that can parse WebAssembly modules into a TinyWasm module. It is based on +This crate provides a parser that can parse WebAssembly modules into a TinyWasm module. It is based on [`wasmparser_nostd`](https://crates.io/crates/wasmparser_nostd) and used by [`tinywasm`](https://crates.io/crates/tinywasm). ## Features @@ -11,11 +11,11 @@ This crate provides a parser that can parse WebAssembly modules into a TinyWasm ## Usage ```rust -use tinywasm_parser::{Parser, TinyWasmModule}; +use tinywasm_parser::Parser; let bytes = include_bytes!("./file.wasm"); let parser = Parser::new(); -let module: TinyWasmModule = parser.parse_module_bytes(bytes).unwrap(); -let mudule: TinyWasmModule = parser.parse_module_file("path/to/file.wasm").unwrap(); -let module: TinyWasmModule = parser.parse_module_stream(&mut stream).unwrap(); +let module = parser.parse_module_bytes(bytes).unwrap(); +let mudule = parser.parse_module_file("path/to/file.wasm").unwrap(); +let module = parser.parse_module_stream(&mut stream).unwrap(); ``` |
