-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Description
I often find myself splitting up modules when they start to feel unwieldy. Instead of having a single thing.rs
module with everything in it, I'd split it up in private sub-modules with re-exports like this:
// thing/mod.rs
mod thing;
mod builder;
// other modules
pub use thing::Thing;
pub use builder::Builder as ThingBuilder;
// other re-exports of stuff in private modules
// thing/thing.rs
pub struct Thing;
Running clippy
warns about module inception on the private mod thing
, even though due to it not being pub
it doesn't show up in the public API and can't be used as thing::thing::Thing
. The (current) lint description is about exactly this issue, i.e. to avoid users of the API having to use thing::thing::Thing
.
Thus, to me it doesn't make sense to apply this lint to private modules. Am I missing something?
Version
rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-unknown-linux-gnu
release: 1.69.0
LLVM version: 15.0.7
Additional Labels
No response
Centri3 and m4rtinkoenig
Metadata
Metadata
Assignees
Labels
No labels