Skip to content

Commit ac956c0

Browse files
committed
Guide: clarify exporting
Mention that using `pub` is called exporting. Remove that `use` is called re-exporting, because `pub use` should be called re-exporting. The guide currently doesn't cover `pub use`.
1 parent 49fcb27 commit ac956c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,8 @@ mod hello {
27272727
}
27282728
```
27292729

2730-
This will work:
2730+
Usage of the `pub` keyword is sometimes called 'exporting', because
2731+
we're making the function available for other modules. This will work:
27312732

27322733
```{notrust,ignore}
27332734
$ cargo run
@@ -3291,8 +3292,7 @@ use super::times_four;
32913292

32923293
Because we've made a nested module, we can import functions from the parent
32933294
module by using `super`. Sub-modules are allowed to 'see' private functions in
3294-
the parent. We sometimes call this usage of `use` a 're-export,' because we're
3295-
exporting the name again, somewhere else.
3295+
the parent.
32963296

32973297
We've now covered the basics of testing. Rust's tools are primitive, but they
32983298
work well in the simple cases. There are some Rustaceans working on building

0 commit comments

Comments
 (0)