Skip to content

Commit 2fb6161

Browse files
committed
Mention pub(crate)
1 parent 24db1bb commit 2fb6161

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/documentation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,9 @@ impl From<PrivateError> for PublicError {
266266
}
267267
}
268268
```
269+
270+
[`pub(crate)`] is another great tool for removing implementation details from
271+
the public API. It allows items to be used from outside of their own module but
272+
not outside of the same crate.
273+
274+
[`pub(crate)`]: https://github.com/rust-lang/rfcs/blob/master/text/1422-pub-restricted.md

0 commit comments

Comments
 (0)