@@ -2,8 +2,9 @@ use std::fs;
22use std:: io:: { self , BufRead , Write } ;
33use std:: path:: PathBuf ;
44
5- use anyhow:: { anyhow, Context as _ , Result } ;
5+ use anyhow:: { anyhow, Result } ;
66use clap:: Parser ;
7+ use wasmtime:: error:: Context ;
78use wizer:: Wizer ;
89
910#[ derive( Parser ) ]
@@ -246,15 +247,12 @@ async fn main() -> Result<()> {
246247 for preload in options. preload . iter ( ) {
247248 if let Some ( ( name, value) ) = preload. split_once ( '=' ) {
248249 let module = wasmtime:: Module :: from_file ( & engine, value)
249- . map_err ( |e| anyhow ! ( e) )
250250 . context ( "failed to parse preload module" ) ?;
251251 let instance = linker
252252 . instantiate ( & mut store, & module)
253- . map_err ( |e| anyhow ! ( e) )
254253 . context ( "failed to instantiate preload module" ) ?;
255254 linker
256255 . instance ( & mut store, name, instance)
257- . map_err ( |e| anyhow ! ( e) )
258256 . context ( "failed to add preload's exports to linker" ) ?;
259257 } else {
260258 anyhow:: bail!(
@@ -270,8 +268,7 @@ async fn main() -> Result<()> {
270268 linker. define_unknown_imports_as_traps ( module) ?;
271269 linker. instantiate ( store, module)
272270 } )
273- . await
274- . map_err ( |e| anyhow ! ( e) ) ?;
271+ . await ?;
275272
276273 output
277274 . write_all ( & output_wasm)
0 commit comments