component_opt/
lib.rs

1mod module;
2mod component;
3
4use thiserror::Error;
5use wasmparser::BinaryReaderError;
6use wasm_opt::OptimizationError;
7
8#[derive(Error, Debug)]
9pub enum ComponentOptError {
10    #[error("Error in wasm-opt")]
11    WasmOpt(#[from] OptimizationError),
12    #[error("IO error")]
13    IO(#[from] std::io::Error),
14    #[error("Unknown section type {section:?}")]
15    UnknownSection { section: String },
16    #[error("Error reading component binary")]
17    BinaryReader(#[from] BinaryReaderError)
18}
19
20pub use component::{optimize_bytes, optimize_file};