#array #macro #length

counted-array

Macro for declaring fixed-size arrays without counting elements by hand. Supports lazy_static.

3 releases

Uses old Rust 2015

0.1.2 Jul 25, 2017
0.1.1 Jan 20, 2017
0.1.0 Apr 13, 2016

#2945 in Rust patterns

Download history 240/week @ 2024-07-20 270/week @ 2024-07-27 235/week @ 2024-08-03 254/week @ 2024-08-10 249/week @ 2024-08-17 192/week @ 2024-08-24 251/week @ 2024-08-31 258/week @ 2024-09-07 233/week @ 2024-09-14 206/week @ 2024-09-21 175/week @ 2024-09-28 149/week @ 2024-10-05 207/week @ 2024-10-12 185/week @ 2024-10-19 226/week @ 2024-10-26 276/week @ 2024-11-02

929 downloads per month

MIT license

5KB

What it is

This crate exports a macro which can be used to declare a fixed-size array without counting the elements by hand. This is achieved by using macro recursion to make rustc count the elements at compile time.

The macro can declare local variables, consts, statics, and lazy statics (if you import that crate, or enable this crate's "nightly" feature).

For examples, see the tests directory.

Dependencies

~4KB