-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Redundant use statement? #4186
Comments
You’re correct; it is extraneous! A long time ago, before the Rust 2018 Edition, it was not, so it likely got missed in cleaning up things from that transition! If you’d like to open a pole request to fix it, that would be very welcome! If not, I will try to get to it sometime this week. |
@chriskrycho thanks for the clarification! I’ll open a PR this week. |
@chriskrycho the PR is up for review 🤞 |
In Listing 14-7 of Chapter 14, the `use add_one;` statement is redundant and can be removed. Before the Rust 2018 edition, this statement was required to bring the `add_one` crate into scope, so it likely got missed during refactorings from that transition. By removing this line, the code becomes more concise and reflects the current best practices for using external crates in Rust. Issue #4186 --------- Co-authored-by: Chris Krycho <[email protected]>
Closing the issue as the associated PR was merged. Thanks! |
Thank you! |
Hello, fellow Rustaceans!
I'm new to Rust and reading this nice book on it. I'm currently on chapter 14. In Listing 14-07, it asks me to add a
use
line to be able to refer to theadd_one
crate.However, even if I omit the use statement at the top, the program still compiles (and I tried it based on my current understanding of how the
use
statement should work).Any thoughts? Thanks!
The text was updated successfully, but these errors were encountered: