You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.rsmod thing;mod builder;// other modules pubuse thing::Thing;pubuse builder::BuilderasThingBuilder;// other re-exports of stuff in private modules
// thing/thing.rspubstructThing;
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?
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:Running
clippy
warns about module inception on the privatemod thing
, even though due to it not beingpub
it doesn't show up in the public API and can't be used asthing::thing::Thing
. The (current) lint description is about exactly this issue, i.e. to avoid users of the API having to usething::thing::Thing
.Thus, to me it doesn't make sense to apply this lint to private modules. Am I missing something?
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: