Skip to content

Instantly share code, notes, and snippets.

@Steboss89
Created June 9, 2021 08:58
Show Gist options
  • Save Steboss89/f5f60d4bec7920bacf0e3244351f0f91 to your computer and use it in GitHub Desktop.
Save Steboss89/f5f60d4bec7920bacf0e3244351f0f91 to your computer and use it in GitHub Desktop.
Use an independent trait in main
fn main() {
let myself = Person{ name: "Stefano".to_string(),
surname: "Bosisio".to_string(),
age: 32 // not yet :P
};
println!("I was born in the {}", myself.compute_year_of_birth());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment