bytecodealliance / wasi-rs

Experimental WASI API bindings for Rust
Apache License 2.0
260 stars 48 forks source link

Improve Display and Debug impls of `Error` #58

Closed pchickey closed 3 years ago

pchickey commented 3 years ago

It is sometimes more useful to have a string of the errno name ("INVAL") than the docs ("Invalid argument." This PR updates witx-bindgen to create functions for errno_name(u16) -> &'static str and renames strerror to errno_docs(u16) -> &'static str. The name is used in Error's Display impl, and both are provided in the Debug impl.

alexcrichton commented 3 years ago

👍