diff options
| author | Garrett Heel <garrettheel@gmail.com> | 2015-01-25 12:57:45 +1000 |
|---|---|---|
| committer | Garrett Heel <garrettheel@gmail.com> | 2015-01-25 12:58:13 +1000 |
| commit | 98c46c30ed6f2ed43f984919c063d38651d6ea9a (patch) | |
| tree | 52921b74eb5cb2935c7525f3428921ad640eaa0e | |
| parent | 4e4e8cff1697ec79bcd0a1e45e63fb2f54a7ea28 (diff) | |
| download | rust-98c46c30ed6f2ed43f984919c063d38651d6ea9a.tar.gz rust-98c46c30ed6f2ed43f984919c063d38651d6ea9a.zip | |
docs: add wildcard syntax in `use` for modules
| -rw-r--r-- | src/doc/trpl/crates-and-modules.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/doc/trpl/crates-and-modules.md b/src/doc/trpl/crates-and-modules.md index efeb201efe8..17b2cf7d0cc 100644 --- a/src/doc/trpl/crates-and-modules.md +++ b/src/doc/trpl/crates-and-modules.md @@ -551,6 +551,10 @@ module, we now have a `phrases::japanese::hello()` function and a `phrases::japanese::farewells::goodbye()`. Our internal organization doesn't define our external interface. +Here we have a `pub use` for each function we want to bring into the +`japanese` scope. We could alternatively use the wildcard syntax to include +everything from `greetings` into the current scope: `pub use self::greetings::*`. + Also, note that we `pub use`d before we declared our `mod`s. Rust requires that `use` declarations go first. |
