#array #length #macro

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

#472 in Rust patterns

Download history 1613/week @ 2021-02-26 2254/week @ 2021-03-05 1958/week @ 2021-03-12 2026/week @ 2021-03-19 1925/week @ 2021-03-26 1423/week @ 2021-04-02 1859/week @ 2021-04-09 1307/week @ 2021-04-16 1769/week @ 2021-04-23 3801/week @ 2021-04-30 3307/week @ 2021-05-07 2417/week @ 2021-05-14 1963/week @ 2021-05-21 1858/week @ 2021-05-28 1393/week @ 2021-06-04 1291/week @ 2021-06-11

8,852 downloads per month
Used in sccache

MIT license

4KB

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