Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/ch01-02-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ requires these around all function bodies. It’s good style to place the openin
curly bracket on the same line as the function declaration, adding one space in
between.

At the time of this writing, an automatic formatter tool called `rustfmt` is
under development. If you want to stick to a standard style across Rust
projects, `rustfmt` will format your code in a particular style. The Rust team
plans to eventually include this tool with the standard Rust distribution, like
`rustc`. So depending on when you read this book, it might already be installed
on your computer! Check the online documentation for more details.
If you want to stick to a standard style across Rust projects, you can use an
automatic formatter tool called `rustfmt` to format your code in a particular
style. The Rust team has included this tool with the standard Rust distribution,
like `rustc`, so it should already be installed on your computer! Check the online
documentation for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I agree that suggesting rustfmt is a good idea, however, it's not part of the default distribution, you need to run a rustup command to get it. I would prefer we either tweak the wording to not imply that it's installed by default or add an example of how to install it.

Copy link
Contributor

@rossmacarthur rossmacarthur Jul 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveklabnik What do you mean by default distribution? rustfmt is included in the default rustup profile. So if someone installed Rust using https://rustup.rs without modifying --profile minimal they will have rustfmt. That seems like default distribution to me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know that! I am curious when this happened, though it appears it's been the case for a fairly long time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this happened when profiles were introduced. https://blog.rust-lang.org/2019/10/15/Rustup-1.20.0.html

Copy link
Contributor Author

@rashiq rashiq Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! So does that mean we could merge this as is? (Sorry been meaning to update this PR but never got around to it)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so; I have to actually have the time to review it again, but I think it should be fine.


Inside the `main` function is the following code:

Expand Down