Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 11267f3

Browse files
style/imports: add example for import ordering
1 parent 6cdc15b commit 11267f3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

style/imports.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,23 @@ sections, in order, with a blank space between each:
88
* local `use` imports
99
* `pub use` imports
1010

11-
> **[FIXME]** add example.
11+
For example:
12+
13+
```rust
14+
// Crates.
15+
extern crate getopts;
16+
extern crate mylib;
17+
18+
// Standard library imports.
19+
use getopts::{optopt, getopts};
20+
use std::os;
21+
22+
// Import from a library that we wrote.
23+
use mylib::webserver;
24+
25+
// Will be reexported when we import this module.
26+
pub use self::types::Webdata;
27+
```
1228

1329
### Avoid `use *`, except in tests. [RFC]
1430

0 commit comments

Comments
 (0)