Created
August 17, 2016 00:35
-
-
Save anonymous/3127edd0271ed975157a8d6152ffa706 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
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::io::{self}; | |
use std::result; | |
type KKResults <T> = Result <T, KKError>; | |
#[derive(Debug)] | |
enum KKError { | |
Io(io::Error), | |
} | |
impl From<io::Error> for KKError { | |
fn from(err: io::Error) -> KKError { | |
KKError::Io(err) | |
} | |
} | |
trait knightknave { | |
fn is_knight_or_knave (&self) -> KKResults <T>; | |
} | |
struct Knight; | |
struct Knave; | |
struct visitor; | |
impl knightknave for visitor { | |
fn is_knight_or_knave(&self) ->KKResults <T> { | |
Ok(()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment