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

style/imports: add example for import ordering #3

Merged
merged 1 commit into from
Jun 30, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion style/imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ sections, in order, with a blank space between each:
* local `use` imports
* `pub use` imports

> **[FIXME]** add example.
For example:

```rust
// Crates.
extern crate getopts;
extern crate mylib;

// Standard library imports.
use getopts::{optopt, getopts};
use std::os;

// Import from a library that we wrote.
use mylib::webserver;

// Will be reexported when we import this module.
pub use self::types::Webdata;
```

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

Expand Down