mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 19:31:30 +11:00
Made the debug text for Error include any sub-errors (#232)
This commit is contained in:
parent
ffa4a55487
commit
b39df21ba8
12
src/error.rs
12
src/error.rs
|
@ -14,7 +14,7 @@ pub enum Error {
|
|||
UpdateFailed(String),
|
||||
}
|
||||
|
||||
impl fmt::Debug for Error {
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
Error::MenusNotSupported => write!(formatter, "Menus not supported"),
|
||||
|
@ -25,13 +25,13 @@ impl fmt::Debug for Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
impl fmt::Debug for Error {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::MenusNotSupported => write!(fmt, "{:?}", self),
|
||||
Error::MenuExists(ref e) => write!(fmt, "{:?} {:?}", self, e),
|
||||
Error::WindowCreate(ref e) => write!(fmt, "{:?} {:?}", self, e),
|
||||
Error::UpdateFailed(ref e) => write!(fmt, "{:?} {:?}", self, e),
|
||||
Error::MenusNotSupported => write!(fmt, "{}", self),
|
||||
Error::MenuExists(ref e) => write!(fmt, "{}, {:?}", self, e),
|
||||
Error::WindowCreate(ref e) => write!(fmt, "{}, {:?}", self, e),
|
||||
Error::UpdateFailed(ref e) => write!(fmt, "{}, {:?}", self, e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue