Skip to content

Commit 98c46c3

Browse files
committed
docs: add wildcard syntax in use for modules
1 parent 4e4e8cf commit 98c46c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/doc/trpl/crates-and-modules.md

+4
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ module, we now have a `phrases::japanese::hello()` function and a
551551
`phrases::japanese::farewells::goodbye()`. Our internal organization doesn't
552552
define our external interface.
553553
554+
Here we have a `pub use` for each function we want to bring into the
555+
`japanese` scope. We could alternatively use the wildcard syntax to include
556+
everything from `greetings` into the current scope: `pub use self::greetings::*`.
557+
554558
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
555559
`use` declarations go first.
556560

0 commit comments

Comments
 (0)