We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5383db5 + ceace1a commit 8819d3eCopy full SHA for 8819d3e
1 file changed
src/mod/use.md
@@ -53,3 +53,24 @@ fn main() {
53
function();
54
}
55
```
56
+
57
+You can also use `pub use` to re-export an item from a module, so it can be
58
+accessed through the module's public interface:
59
60
+```rust,editable
61
+mod deeply {
62
+ pub mod nested {
63
+ pub fn function() {
64
+ println!("called `deeply::nested::function()`");
65
+ }
66
67
+}
68
69
+mod cool {
70
+ pub use crate::deeply::nested::function;
71
72
73
+fn main() {
74
+ cool::function();
75
76
+```
0 commit comments