auto_array 0.1.0

A macro to automatically calculate the length of arrays
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented1 out of 1 items with examples
  • Size
  • Source code size: 7.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 98.23 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 23s Average build duration of successful builds.
  • all releases: 23s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Lars-Schumann/auto_array
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Lars-Schumann

What?

Automatically calculates the length of Arrays for you.

How?

use auto_array::auto_array;

fn main() {
    auto_array! {
        // Additional attributes, docs, and visibility are supported.
        /// A const array.
        #[allow(unused)]
        const A: [u8; _] = [3, 3, 3];
        /// A static array with conditional compilation and pub(crate) visibility.
        pub(crate) static B: [u8; _] = [1, #[cfg(unix)] 2];
    }
    assert_eq!(A, [3, 3, 3]);
    assert_eq!(B, [1, #[cfg(unix)] 2]);
}