-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
TRPL: new introduction #24239
TRPL: new introduction #24239
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
Rust. It has individual sections on each part of Rust's syntax. | ||
* [Getting started][gs] - Set up your computer for Rust development. | ||
* [Learn Rust][lr] - Learn Rust programming through small projects. | ||
* [Effective Rust][er] - Higher level concepts for writing excellent Rust code. |
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.
s/Higher level/Higher-level/
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.
nice catch, fixing
54b33a9
to
e9426f7
Compare
requirements, and writing low-level code, like device drivers and operating | ||
systems. It improves on current languages targeting this space by having a | ||
number of compile-time safety checks that produce no runtime overhead, but | ||
eliminate all data races. These checks can be used to form ‘zero-cost |
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.
"but eliminate" -> "while eliminating"
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.
nice catch, thanks
e9426f7
to
d9a78a0
Compare
or ‘Syntax and Semantics’, depending on your preference: ‘Learn Rust’ if you | ||
want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to | ||
start small, and learn a single concept thoroughly before moving onto the next. | ||
Copious cross-linking will help connect these parts together. |
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.
Not sure if this line is helpful.
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 think in general I'm a bit more verbose than you are in this. :)
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.
This one will probably help some readers relax
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 future tense sounds a little weird to me, maybe make it live in now more :P ("copious cross-linking connects these parts together"?)
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 it
d9a78a0
to
a0ebd5e
Compare
```rust | ||
fn main() { | ||
let x = vec![1, 2, 3]; | ||
|
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 find these extra spaces ugly. Also, it's not what's going to happen in real code, and the differences are visible enough anyways. I'd rather you do this if you want emphasis:
fn main() {
let x = vec![1, 2, 3];
let y = &x[0]; // added
}
then
fn main() {
let x = vec![1, 2, 3];
let y = &x[0];
x.push(4); // added
}
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.
it's not what's going to happen in real code
If I were to write this code for real, I would put those spaces there. The principle is 'coding in paragraphs', each separate thing gets a newline. In more real code, there might be two or three things between each space, but I find your version to be quite cramped.
a0ebd5e
to
db058f8
Compare
|
||
This chapter contains things that are only available on the nightly channel of | ||
Rust. | ||
```rust |
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.
Is this code example really worth the space in the brief intro? This seems like a case when space is at a premium and we want to make it as "tight" as reasonable. It seems to me that the paragraph above is probably all that's needed, or even reduced further with some cross-links to more explanations (Rust is statically typed but has type inference, so type annotations are [optional](...)
).
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.
👍
(All my comments are meant to be discussion starters, I'm not rabidly in favour of any of them, just wondering if we could |
2be0873
to
90d6965
Compare
90d6965
to
bf88539
Compare
I want to land this so that it gets into the nightly tonight. If there's any more nits, please open an issue and I'll just take care of it, but I don't want to have another day with the intro being just straight-up wrong. :) |
@bors: r+ rollup |
📌 Commit bf88539 has been approved by |
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
|
||
let y = x[0].clone(); | ||
|
||
x.push(4); |
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.
Why push an integer to a vector of &str?
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.
nice catch
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
…labnik Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction. It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.
Needs 0a2885a |
Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction.
It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.