New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: generics section of structs chapter #104
Conversation
A light introduction to syntax.
r? @aturon |
x: f64, | ||
y: f64, | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like starting out with concrete and then taking it generic.
For this example, I was wondering if it should start even simpler. Eg) just struct Point { ... } without any derives. Helps us to minimize concept count a bit and also helps avoid them later passing a type that doesn't satisfy one of these traits and getting a confusing error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dealt with the derives and such in the previous section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steveklabnik - I suspect people will likely not read from front to back, and that they'll often come here from googling "generics in Rust" or something similar. If possible, it may help to limit the concept count in any given section/chapter to what's necessary for that chapter to help readability for those types of readers (at the very least, limit concept count for your motivating example...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The book is really meant to read front to back, unfortunately, or at least, it's not intended to be reference-style, but "read this in order to learn Rust."
Okay everyone, I have pushed a few things to address most of the comments here. I'm going to merge this one now, please open issues if there's anything else particularly important. |
Translating ch05-02 in French
…lation-take2 rectangle の訳語:「四角形」→「長方形」(その2)
…a-in-10-2 오타 수정
A light introduction to syntax.