Created
January 24, 2015 03:53
-
-
Save anonymous/929aaf089ee55e7cd268 to your computer and use it in GitHub Desktop.
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
use std::fmt; | |
use std::error::Error; | |
struct Foo; | |
impl Error for Foo { | |
fn description(&self) -> &str { "foo" } | |
} | |
impl fmt::Display for Foo { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
self.description().fmt(f) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment