rust-clippy
rust-clippy copied to clipboard
`wildcard_imports` should allow filesystem-structural wildcard re-exports even for `pub(crate) use` as it already allows for `pub use`
It is valuable to organize code in different files without necessarily representing that hierarchy in the module tree, by re-exporting types up toward the root:
mod foo;
pub use foo::*;
Here, we publicly expose T from foo.rs not as crate::foo::T but as crate::T - the module is merely to better organize code, not as something meant to express public API module structure.
That works fine and is allowed by clippy::wildcard_exports in its default configuration.
This technique is also valuable for non-public types:
mod foo;
pub(crate) use foo::*;
Unfortunately, clippy::wildcard_exports is not happy about this one. I believe it should be happy about it - this is just another form of the same pattern and whether it says pub or pub(crate) should not make any difference.