domain
domain copied to clipboard
[Code Style] Position of `#[cfg]` for modules
The codebase currently contains a mix of:
// In `lib.rs`:
#[cfg(feature = "foo")]
mod foo;
and:
// In `foo/mod.rs`:
#![cfg(feature = "foo")]
We should decide on which one is more appropriate and use it uniformly.
What complicates the discussion is that we tend to do things like:
#![cfg_attr(feature = "foo", doc = "* [foo]:")]
#![cfg_attr(not(feature = "foo"), doc = "* foo:")]
in the parent module. So #![cfg(feature = "foo")] seems nicely self contained, but it spread the test over two modules.