Skip to content

Commit

Permalink
thanks clippy!
Browse files Browse the repository at this point in the history
  • Loading branch information
tessi committed Sep 18, 2023
1 parent e514055 commit b47057d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions native/wasmex/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,15 @@ fn wasi_preopen_directories(
preopens: Vec<ExWasiPreopenOptions>,
builder: WasiCtxBuilder,
) -> Result<WasiCtxBuilder, rustler::Error> {
let builder = preopens.iter().fold(Ok(builder), |builder, preopen| {
preopens.iter().try_fold(builder, |builder, preopen| {
preopen_directory(builder, preopen)
})?;
Ok(builder)
})
}

fn preopen_directory(
builder: Result<WasiCtxBuilder, Error>,
builder: WasiCtxBuilder,
preopen: &ExWasiPreopenOptions,
) -> Result<WasiCtxBuilder, Error> {
let builder = builder?;
let path = &preopen.path;
let dir = wasmtime_wasi::Dir::from_std_file(
std::fs::File::open(path).map_err(|err| rustler::Error::Term(Box::new(err.to_string())))?,
Expand Down

0 comments on commit b47057d

Please sign in to comment.