You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-27 11:08:45 +02:00
Document the historical reference in the newtypes example (#826)
Document the historical reference in the newtypes example.
This commit is contained in:
@ -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)`.
|
* 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.
|
* 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.
|
* 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>
|
</details>
|
||||||
|
Reference in New Issue
Block a user