auto-const-array

Crates.ioauto-const-array
lib.rsauto-const-array
version0.2.1
sourcesrc
created_at2022-11-22 07:14:13.030994
updated_at2023-07-11 03:09:53.295508
descriptionDefine a const array without specify length.
homepage
repositoryhttps://github.com/ihciah/auto-const-array
max_upload_size
id720655
size21,675
ihc童鞋@提不起劲 (ihciah)

documentation

README

Auto Const Array

Use this macro to declare a const array without specifing its length.

Crates.io MIT/Apache-2 licensed

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]
}
Commit count: 4

cargo fmt