Crates.io | auto-const-array |
lib.rs | auto-const-array |
version | 0.2.1 |
source | src |
created_at | 2022-11-22 07:14:13.030994 |
updated_at | 2023-07-11 03:09:53.295508 |
description | Define a const array without specify length. |
homepage | |
repository | https://github.com/ihciah/auto-const-array |
max_upload_size | |
id | 720655 |
size | 21,675 |
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]
}