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 <nathaniel@profian.com>

Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
This commit is contained in:
Nathaniel McCallum
2022-10-04 17:00:42 -04:00
committed by GitHub
parent b07e619055
commit d986b3cbc2

View File

@@ -28,7 +28,8 @@ pub use anyhow::{Context, Error};
/// Internal error type for the `wasi-common` crate. /// 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 /// 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. /// 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 { pub enum ErrorKind {
/// Errno::WouldBlk: Would block /// Errno::WouldBlk: Would block
#[error("WouldBlk: Would block")] #[error("WouldBlk: Would block")]