| Age | Commit message (Collapse) | Author | Lines |
|
|
|
I'm currently reading the rust book and this variable name tripped me up.
Because it was called "input", I thought at first it might contain the line
read by read_line(). This new variable name will be more instructive to rust
beginners.
|
|
The doc indicates that you can replace 'before' with 'after' showing the use of try!. The two examples should be equivalent, but they are not.
In the File::create we were inducing a panic before in case of error, not propagating. It is important for newbies (like myself) to understand that try! propagates failures, while unwrap can induce a panic.
The other alternative is to make the 'before' File::create also manually handle Err like the other calls. Either way it would be consistent.
|
|
`{rust,ignore}` -> `rust,ignore
|
|
|
|
I don't recall reading about this `Debug` trait so far in the book.
|
|
The text in iterators.md wasn't wrong, but it read awkwardly to my ear.
|
|
Fix two typos while `io::stdin().read_line()` returns `Result` actually
Signed-off-by: acgtyrant <acgtyrant@gmail.com>
|
|
- `FIle::open` is for opening a file in read-only mode
- `FIle::create` is for opening a file in write-only mode, which is what we want instead for this example to make sense
|
|
Fixes #24185
|
|
|
|
Not sure if `From<Error>` is the correct way to reference that trait (maybe `From<E: Error>`?)
|
|
Fix example and some text for: `read_line` takes `&mut String` and return `Result` instead `IoResult`.
|
|
Fixes #22342
|
|
|
|
"Idiomatic code should not use extra whitespace in the middle of a line to provide alignment."
http://aturon.github.io/style/whitespace.html
I realize the linked page still needs an RFC, but the docs should be written in accordance with the guidelines nevertheless.
|
|
|
|
|
|
|
|
This commit is an attempt to standardize the use of punctuation and
formatting in "The Rust Programming Language" as discussed in #19823.
- Convert bold text to italicized textcwhen referring to terminology.
- Convert single-quoted text to italicized or double-quoted text,
depending on context.
- Use double quotes only in the case of scare quotes or quotations.
|
|
|