Implement fmt::Display for enums, flags, and ints (#18)

* Implement fmt::Display for enums

`wasi_common` relies on `strerror` to nicely format error messages.
`strerror` is autoimplemented in `wig`. I thought it might be useful
to provide a Rust-idiomatic alternative which boils down to autoimplementing
`fmt::Display` for all enums.

* Implement fmt::Display for flags

* Implement fmt::Display for ints
This commit is contained in:
Jakub Konka
2020-02-24 21:11:08 +01:00
committed by GitHub
parent b7cd003b93
commit 678065011e
2 changed files with 43 additions and 9 deletions

View File

@@ -1,8 +1,13 @@
(typename $errno
(enum u32
;;; Success
$ok
;;; Invalid argument
$invalid_arg
;;; I really don't want to
$dont_want_to
;;; I am physically unable to
$physically_unable
;;; Well, that's a picket line alright!
$picket_line))