Skip to content
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

Lint code samples in The Rust Programming Language online book #745

Closed
parhaml opened this issue Apr 19, 2019 · 2 comments
Closed

Lint code samples in The Rust Programming Language online book #745

parhaml opened this issue Apr 19, 2019 · 2 comments

Comments

@parhaml
Copy link

parhaml commented Apr 19, 2019

Content Bug Report

Page(s) Affected

One example:

The code for setting the guess:

io::stdin().read_line(&mut guess)
    .expect("Failed to read line");

Then running rustfmt main.rs re-formats the code:

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!

@yoshuawuyts
Copy link
Member

@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!

@parhaml
Copy link
Author

parhaml commented Apr 22, 2019

Closing this issue in favor of
rust-lang/book#1690

@parhaml parhaml closed this as completed Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants