Created
June 9, 2021 08:58
-
-
Save Steboss89/f5f60d4bec7920bacf0e3244351f0f91 to your computer and use it in GitHub Desktop.
Use an independent trait in main
This file contains hidden or 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
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