Skip to content

Commit

Permalink
Add additional rules about imports (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-tkach committed Sep 10, 2018
1 parent f6fb77d commit d04bfa6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -62,6 +62,20 @@ but we have several additional conventions:

- Prefer [nested imports] whenever possible.

- Don't try to minimize imports scope (for example don't put it inside a
function), place them at the beginning of the file.

- Avoid leading `::` in the type names (for example `::std::path::Path`),
instead import a type and use a shorter form:

```rust
// Import type:
use std::path::Path;

// Use it:
let path = Path::new("...");
```

- Modules and imports (`use`) should be in the following order:

- `extern crate`s.
Expand Down

0 comments on commit d04bfa6

Please sign in to comment.