forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement fmt::Display for enums, flags, and ints (bytecodealliance#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
- Loading branch information
Showing
2 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) | ||
|