From d986b3cbc200c8dae8d16d98f9df44de5f0fb355 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Tue, 4 Oct 2022 17:00:42 -0400 Subject: [PATCH] feat: improve wasi_common::ErrorKind derives (#5006) Besides the standard traits (Copy, Clone, PartialEq and Eq), we also mark the trait as non-exhaustive so that we can add errors in the future without breaking API. Signed-off-by: Nathaniel McCallum Signed-off-by: Nathaniel McCallum --- crates/wasi-common/src/error.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/wasi-common/src/error.rs b/crates/wasi-common/src/error.rs index 0d50ab213c..b5731643f6 100644 --- a/crates/wasi-common/src/error.rs +++ b/crates/wasi-common/src/error.rs @@ -28,7 +28,8 @@ pub use anyhow::{Context, Error}; /// Internal error type for the `wasi-common` crate. /// Contains variants of the WASI `$errno` type are added according to what is actually used internally by /// the crate. Not all values are represented presently. -#[derive(Debug, thiserror::Error)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, thiserror::Error)] +#[non_exhaustive] pub enum ErrorKind { /// Errno::WouldBlk: Would block #[error("WouldBlk: Would block")]