Skip to content

Instantly share code, notes, and snippets.

@aalvarado
Created December 7, 2015 22:43
Show Gist options
  • Save aalvarado/ac8cafc25fdacd9f7473 to your computer and use it in GitHub Desktop.
Save aalvarado/ac8cafc25fdacd9f7473 to your computer and use it in GitHub Desktop.
struct Person;
impl Person {
fn hello(&self) -> &'static str {
return "hello";
}
}
fn main() {
println!("Hello, world!");
let p = Person;
println!("{}", p.hello());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment