4 releases
0.1.0 | Sep 2, 2023 |
---|---|
0.0.1 | Mar 6, 2021 |
0.0.0 | Mar 6, 2021 |
#1178 in Rust patterns
17,335 downloads per month
Used in 49 crates
(15 directly)
7KB
#[visibility::make]
Attribute to override the visibility of items (especially useful in conjunction with #[cfg_attr(…)]
).
Since it is currently not possible to conditionally modify the visibility of an item, but since it is possible to conditionally apply an attribute, this crate features a trivial attribute that modifies the visibility of the decorated item. This way, by conditionally applying it, one can achieve the desired goal:
Example
/// Some fancy docs.
///
/// ## Example
///
/// ```rust
/// ::my_crate::module::foo();
/// ```
// Assuming `cargo test --doc --features integration-tests` is run:
#[cfg_attr(feature = "integration-tests", visibility::make(pub))]
mod module {
pub fn foo() {}
}
Dependencies
~315–760KB
~18K SLoC