diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2014-05-29 15:17:00 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2014-06-02 23:21:35 +0900 |
| commit | e38fde71b1dede9772043b71fe09c43b4ba61b8c (patch) | |
| tree | 969b3256368a6f6c711af90f94041db99c040aa7 /src/doc/rust.md | |
| parent | b981add9ee56a2d6dc11aa48f01aac5d0dda9327 (diff) | |
| download | rust-e38fde71b1dede9772043b71fe09c43b4ba61b8c.tar.gz rust-e38fde71b1dede9772043b71fe09c43b4ba61b8c.zip | |
doc: Remove use of `pub use` globs
Diffstat (limited to 'src/doc/rust.md')
| -rw-r--r-- | src/doc/rust.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/rust.md b/src/doc/rust.md index cde26bd8813..61fd83c10d4 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -904,7 +904,7 @@ An example of re-exporting: ~~~~ # fn main() { } mod quux { - pub use quux::foo::*; + pub use quux::foo::{bar, baz}; pub mod foo { pub fn bar() { } @@ -913,10 +913,10 @@ mod quux { } ~~~~ -In this example, the module `quux` re-exports all of the public names defined in `foo`. +In this example, the module `quux` re-exports two public names defined in `foo`. Also note that the paths contained in `use` items are relative to the crate root. -So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`. +So, in the previous example, the `use` refers to `quux::foo::{bar, baz}`, and not simply to `foo::{bar, baz}`. This also means that top-level module declarations should be at the crate root if direct usage of the declared modules within `use` items is desired. It is also possible to use `self` and `super` at the beginning of a `use` item to refer to the current and direct parent modules respectively. |
