Created
January 31, 2021 04:38
-
-
Save grahamking/3baab0e649bfe14ba28ae00380a230b3 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
trait SurelyNot { | |
fn can_we_build_it(&self); | |
} | |
impl SurelyNot for String { | |
fn can_we_build_it(&self) { | |
println!("Yes we can"); | |
} | |
} | |
fn main() { | |
let s = String::new(); | |
s.can_we_build_it(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment