Update to wasmparser 0.51
wasmparser::BinaryReaderError now encapsulates its fields, so call the accessors rather than destructuring to get the fields.
This commit is contained in:
@@ -55,7 +55,7 @@ pub enum WasmError {
|
||||
#[error("Invalid input WebAssembly code at offset {offset}: {message}")]
|
||||
InvalidWebAssembly {
|
||||
/// A string describing the validation error.
|
||||
message: &'static str,
|
||||
message: std::string::String,
|
||||
/// The bytecode offset where the error occurred.
|
||||
offset: usize,
|
||||
},
|
||||
@@ -90,8 +90,10 @@ macro_rules! wasm_unsupported {
|
||||
impl From<BinaryReaderError> for WasmError {
|
||||
/// Convert from a `BinaryReaderError` to a `WasmError`.
|
||||
fn from(e: BinaryReaderError) -> Self {
|
||||
let BinaryReaderError { message, offset } = e;
|
||||
Self::InvalidWebAssembly { message, offset }
|
||||
Self::InvalidWebAssembly {
|
||||
message: e.message().into(),
|
||||
offset: e.offset(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user