diff options
Diffstat (limited to 'src/tools/clippy/src/docs/pub_use.txt')
-rw-r--r-- | src/tools/clippy/src/docs/pub_use.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/pub_use.txt b/src/tools/clippy/src/docs/pub_use.txt new file mode 100644 index 000000000..407cafa01 --- /dev/null +++ b/src/tools/clippy/src/docs/pub_use.txt @@ -0,0 +1,28 @@ +### What it does + +Restricts the usage of `pub use ...` + +### Why is this bad? + +`pub use` is usually fine, but a project may wish to limit `pub use` instances to prevent +unintentional exports or to encourage placing exported items directly in public modules + +### Example +``` +pub mod outer { + mod inner { + pub struct Test {} + } + pub use inner::Test; +} + +use outer::Test; +``` +Use instead: +``` +pub mod outer { + pub struct Test {} +} + +use outer::Test; +```
\ No newline at end of file |