cfg-vis

Crates.iocfg-vis
lib.rscfg-vis
version0.2.2
sourcesrc
created_at2023-01-11 15:15:10.505215
updated_at2023-02-11 09:40:48.728814
descriptionA macro to support `#[cfg()]` on visibility.
homepage
repositoryhttps://github.com/TOETOE55/cfg-vis
max_upload_size
id756477
size13,461
Danube (TOETOE55)

documentation

README

cfg-vis

A macro to support #[cfg()] on visibility.

use cfg_vis::{cfg_vis, cfg_vis_fields};

// default visibility is `pub`, while the target is linux, the visibility is `pub(super)`.
#[cfg_vis(target_os = "linux", pub(super))]
pub fn foo() {}

#[cfg_vis_fields]
pub struct Foo {
    #[cfg_vis(test, pub)]
    pub_in_test: i32,
    #[cfg_vis(test)]
    pub prv_in_test: i32,
}
Commit count: 17

cargo fmt