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
Detects usage of pub use. This statement effectively exports a type or module as if it is a member of the current module.
Lint Name
detect_pub_use
Category
pedantic
Advantage
sometimes when reexporting multiple types, it isn't clear you have exported all the types, resulting in some types which should be public but may not be explicitly named in code.
a pub use statement for crate types may be better exposed by placing the type in a public module instead of explicitly exporting it and making private details crate private or module private.
Drawbacks
sometimes this is intended, especially for opaque retuen types or reexporting a crate for library usage, hence the pedantic categorization. This might be better done via an impl Trait return type if the type needs to be private details of a library.
the issue being solved might make more sense as an specialized lint working off public visibility.
Example
mod priv_mod {...}pubuseself::priv_mod::PublicType;
Could be placed in a public module, or the module the type inhabits made public.
The text was updated successfully, but these errors were encountered:
What it does
Detects usage of
pub use
. This statement effectively exports a type or module as if it is a member of the current module.Lint Name
detect_pub_use
Category
pedantic
Advantage
Drawbacks
impl Trait
return type if the type needs to be private details of a library.Example
Could be placed in a public module, or the module the type inhabits made public.
The text was updated successfully, but these errors were encountered: