From 7cf30d0824114df31608015e6ceff606ea9b2695 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 27 Mar 2020 18:29:14 -0700 Subject: [PATCH] wasi-common: updates to GuestErrorType/ GuestErrorConversion --- crates/wasi-common/src/wasi.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/wasi-common/src/wasi.rs b/crates/wasi-common/src/wasi.rs index 5c634518bc..53dbd5476b 100644 --- a/crates/wasi-common/src/wasi.rs +++ b/crates/wasi-common/src/wasi.rs @@ -11,17 +11,17 @@ wiggle::from_witx!({ pub use types::Errno; pub type Result = std::result::Result; -impl<'a> wiggle::GuestErrorType<'a> for Errno { - type Context = WasiCtx; - +impl wiggle::GuestErrorType for Errno { fn success() -> Self { Self::Success } +} - fn from_error(e: wiggle::GuestError, _ctx: &Self::Context) -> Self { +impl types::GuestErrorConversion for WasiCtx { + fn into_errno(&self, e: wiggle::GuestError) -> Errno { eprintln!("Guest error: {:?}", e); // TODO proper error mapping - Self::Inval + Errno::Inval } }