Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. use std::fmt::{Display, Formatter, Error};
  2.  
  3. struct MyLocalType;
  4.  
  5. type MyResult = Result<MyLocalType, String>;
  6.  
  7. impl Display for MyResult {
  8. fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
  9. f.write_str("some test string")
  10. }
  11. }
  12.  
  13. fn main() {
  14. let r: MyResult = Ok(MyLocalType);
  15. println!("{}" , r);
  16. }
  17.  
  18. impl Display for Result<MyLocalType, String>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement