2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -23,4 +23,9 @@ fn main() {
|
|||
// get the answer to life
|
||||
// by calling the instance method of object foo
|
||||
println!("The answer to life is {}.", foo.get_the_answer_to_life());
|
||||
|
||||
// Note that in Rust, methods still work on references to the object.
|
||||
// Rust will automatically do the appropriate dereferencing to get the method to work:
|
||||
let lots_of_references = &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&foo;
|
||||
println!("The answer to life is still {}." lots_of_references.get_the_answer_to_life());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue