-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify imports by importing fewer items directly (#2404)
When reading the code without an IDE, I find it useful to use explicit module names, especially when items come from the standard library. So `io::Error` instead of just `Error`, especially when people have just been told about `std::error::Error` as well. I also omitted most single-use items: I find it has less cognitive overhead to say “we import `fmt`” and then later use `fmt::Display` and `fmt::Formatter` in the code. It’s clear from the name that these two things have something to do with formatting. Finally, I made a few usages more consistent so that we refer to each item in the same way within a single codeblock.
- Loading branch information
Showing
5 changed files
with
16 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters