1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-15 15:16:51 +02:00

Add note about struct field defaults (#2666)

This commit is contained in:
Nicole L 2025-02-27 12:31:56 -08:00 committed by GitHub
parent df57606996
commit fdb0a398b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,6 +53,8 @@ Key Points:
not important. not important.
- If you already have variables with the right names, then you can create the - If you already have variables with the right names, then you can create the
struct using a shorthand. struct using a shorthand.
- Struct fields do not support default values. Default values are specified by
implementing the `Default` trait which we will cover later.
## More to Explore ## More to Explore