Skip to content

Commit 130b26e

Browse files
committed
doc: Remove pub use globs
1 parent 0a06e34 commit 130b26e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/rust.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ An example of re-exporting:
904904
~~~~
905905
# fn main() { }
906906
mod quux {
907-
pub use quux::foo::*;
907+
pub use quux::foo::{bar, baz};
908908
909909
pub mod foo {
910910
pub fn bar() { }
@@ -913,10 +913,10 @@ mod quux {
913913
}
914914
~~~~
915915

916-
In this example, the module `quux` re-exports all of the public names defined in `foo`.
916+
In this example, the module `quux` re-exports two public names defined in `foo`.
917917

918918
Also note that the paths contained in `use` items are relative to the crate root.
919-
So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
919+
So, in the previous example, the `use` refers to `quux::foo::{bar, baz}`, and not simply to `foo::{bar, baz}`.
920920
This also means that top-level module declarations should be at the crate root if direct usage
921921
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
922922
at the beginning of a `use` item to refer to the current and direct parent modules respectively.

0 commit comments

Comments
 (0)