1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-12 05:24:12 +02:00

Update example.md (#441)

This commit is contained in:
Adam MacBeth 2023-02-18 20:53:11 -08:00 committed by GitHub
parent 9510e80165
commit aef4c3ca72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ Key Points:
* All four methods here use a different method receiver.
* You can point out how that changes what the function can do with the variable values and if/how it can be used again in `main`.
* You can showcase the error that appears when trying to call `finish` twice.
* Note, that although the method receivers are different, the non-static functions are called the same way in the main body. Rust enables automatic referencing and dereferencing when calling methods. Rust automatically adds in the `&`, `*`, `muts` so that that object matches the method signature.
* Note that although the method receivers are different, the non-static functions are called the same way in the main body. Rust enables automatic referencing and dereferencing when calling methods. Rust automatically adds in the `&`, `*`, `muts` so that that object matches the method signature.
* You might point out that `print_laps` is using a vector that is iterated over. We describe vectors in more detail in the afternoon.
</details>