GuestErrorType only needs to have a success constructor

This commit is contained in:
Pat Hickey
2020-03-27 14:31:59 -07:00
parent 9ca3bf532e
commit 167a040ea5
5 changed files with 12 additions and 27 deletions

View File

@@ -23,18 +23,10 @@ fn document_equivelant() {
type Result<T> = std::result::Result<T, types::Errno>;
impl<'a> GuestErrorType<'a> for types::Errno {
type Context = WasiCtx<'a>;
impl GuestErrorType for types::Errno {
fn success() -> types::Errno {
types::Errno::Success
}
fn from_error(e: GuestError, ctx: &Self::Context) -> types::Errno {
eprintln!("GUEST ERROR: {:?}", e);
ctx.guest_errors.borrow_mut().push(e);
types::Errno::Io
}
}
impl<'a> crate::wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx<'a> {