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

Commit

Permalink
Browse files Browse the repository at this point in the history
style/imports: add example for import ordering
  • Loading branch information
nathantypanski committed Jun 30, 2014
1 parent 6cdc15b commit 11267f3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion style/imports.md
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

0 comments on commit 11267f3

Please sign in to comment.