You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-15 22:00:26 +02:00
Various small fixes (#1556)
Plus one more substantial comment on casting.
This commit is contained in:
@ -68,9 +68,6 @@ Key Points:
|
||||
|
||||
Rust has several optimizations it can employ to make enums take up less space.
|
||||
|
||||
* Niche optimization: Rust will merge unused bit patterns for the enum
|
||||
discriminant.
|
||||
|
||||
* Null pointer optimization: For [some
|
||||
types](https://doc.rust-lang.org/std/option/#representation), Rust guarantees
|
||||
that `size_of::<T>()` equals `size_of::<Option<T>>()`.
|
||||
|
@ -51,6 +51,6 @@ Key Points:
|
||||
* The next slide will introduce Tuple structs, used when the field names are not important.
|
||||
* If you already have variables with the right names, then you can create the
|
||||
struct using a shorthand.
|
||||
* The syntax `..peter` allows us to copy the majority of the fields from the old struct without having to explicitly type it all out. It must always be the last element.
|
||||
* The syntax `..avery` allows us to copy the majority of the fields from the old struct without having to explicitly type it all out. It must always be the last element.
|
||||
|
||||
</details>
|
||||
|
Reference in New Issue
Block a user