Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt::{Display, Formatter, Error};
- struct MyLocalType;
- type MyResult = Result<MyLocalType, String>;
- impl Display for MyResult {
- fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
- f.write_str("some test string")
- }
- }
- fn main() {
- let r: MyResult = Ok(MyLocalType);
- println!("{}" , r);
- }
- impl Display for Result<MyLocalType, String>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement