Skip to content

Commit

Permalink
no need for preopened_path really
Browse files Browse the repository at this point in the history
  • Loading branch information
pchickey committed Mar 26, 2021
1 parent a6a8a7f commit c5d6c3f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions crates/wasi-common/cap-std-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ impl WasiCtxBuilder {
let dir = Box::new(crate::dir::Dir::from_cap_std(dir));
Ok(WasiCtxBuilder(self.0.preopened_dir(dir, guest_path)?))
}

pub fn preopened_path(
self,
host_path: impl AsRef<Path>,
guest_path: impl AsRef<Path>,
) -> Result<Self, Error> {
let host_path = host_path.as_ref();
let dir = unsafe { Dir::open_ambient_dir(host_path) }
.with_context(|| format!("Failed to preopen host path: {:?}", host_path))?;
self.preopened_dir(dir, guest_path)
}

pub fn build(self) -> Result<WasiCtx, Error> {
self.0.build()
}
Expand Down

0 comments on commit c5d6c3f

Please sign in to comment.