4 releases
0.2.1 | Jul 11, 2023 |
---|---|
0.2.0 | Nov 22, 2022 |
0.1.1 | Nov 22, 2022 |
0.1.0 | Nov 22, 2022 |
#1539 in Procedural macros
2,295 downloads per month
Used in 26 crates
(via monoio)
8KB
131 lines
Auto Const Array
Use this macro to declare a const array without specifing its length.
use auto_const_array::auto_const_array;
auto_const_array! {
// Additional attributes and docs are supported.
/// Common array with public visibility.
#[allow(unused)]
pub const ARRAY_COMMON: [u8; _] = [1, 2, 4];
/// Special array with cfg conditional compling.
const ARRAY_WITH_ATTR: [u8; _] = [1, #[cfg(unix)] 2]
}
Dependencies
~310–770KB
~18K SLoC