This repository was archived by the owner on Oct 9, 2018. It is now read-only.
This repository was archived by the owner on Oct 9, 2018. It is now read-only.
Clarify where imports should be placed #27
Open
Description
In most code, use
imports are placed directly at the top of the file/module. However, sometimes I see them situated within a function. The Rust guidelines would be a great place to clarify where use
imports should be placed. My recommendation would be to put all imports at the top of the module, except maybe for tests, where any imports specific to that function should be placed within that function only. (For example, if only one test uses std::collections::HashMap
, the use
statement should be placed within that function only.) Oh, and maybe main
should also have any specific imports at the top of the function rather than the module.
Metadata
Metadata
Assignees
Labels
No labels