Skip to content

Instantly share code, notes, and snippets.

@grahamking
Created January 31, 2021 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamking/3baab0e649bfe14ba28ae00380a230b3 to your computer and use it in GitHub Desktop.
Save grahamking/3baab0e649bfe14ba28ae00380a230b3 to your computer and use it in GitHub Desktop.
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