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 |
#73 in #auto
8,102 downloads per month
Used in 36 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
~235–680KB
~16K SLoC