Www.rust-lang.org: Lint code samples in The Rust Programming Language online book

Created on 19 Apr 2019  路  2Comments  路  Source: rust-lang/www.rust-lang.org

Content Bug Report

Page(s) Affected

One example:

The code for setting the guess:
```(rust)
io::stdin().read_line(&mut guess)
.expect("Failed to read line");

Then running `rustfmt main.rs` re-formats the code:
```(rust)
io::stdin()
    .read_line(&mut guess)
    .expect("Failed to read line");

This is just the first one that I came across.

What needs to be fixed?

The code sample _seems_ to be formatted incorrectly according to rustfmt. For new learners, it would be nice to present correctly formatted code from the outset.

Suggested Improvement

If this is something that needs to be done, I'd be happy to run each sample through rustfmt and make the suggested changes. If not, no worries and thanks for the great resource!

Most helpful comment

Closing this issue in favor of
https://github.com/rust-lang/book/issues/1690

All 2 comments

@parhaml I'd be open to patches to merging patches that format the code examples using rustfmt; I think your reasoning here makes a lot of sense!

Closing this issue in favor of
https://github.com/rust-lang/book/issues/1690

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ashleygwilliams picture ashleygwilliams  路  3Comments

Veedrac picture Veedrac  路  5Comments

camelid picture camelid  路  4Comments

Diggsey picture Diggsey  路  6Comments

Manishearth picture Manishearth  路  6Comments