Skip to content

Commit

Permalink
feat: improve wasi_common::ErrorKind derives (#5006)
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: Nathaniel McCallum <[email protected]>
  • Loading branch information
npmccallum authored Oct 4, 2022
1 parent b07e619 commit d986b3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/wasi-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit d986b3c

Please sign in to comment.