1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-18 05:37:52 +02:00

Document the historical reference in the newtypes example (#826)

Document the historical reference in the newtypes example.
This commit is contained in:
Victor Costan 2023-06-18 05:37:57 -07:00 committed by GitHub
parent cb32c4d108
commit b2ebd8848c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,5 +39,6 @@ fn main() {
* The value passed some validation when it was created, so you no longer have to validate it again at every use: 'PhoneNumber(String)` or `OddNumber(u32)`.
* Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single field in the newtype.
* Rust generally doesn’t like inexplicit things, like automatic unwrapping or for instance using booleans as integers.
* Operator overloading is discussed on Day 3 (generics).
* Operator overloading is discussed on Day 3 (generics).
* The example is a subtle reference to the [Mars Climate Orbiter](https://en.wikipedia.org/wiki/Mars_Climate_Orbiter) failure.
</details>