#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

#2968 in Rust patterns

Download history 204/week @ 2023-11-27 206/week @ 2023-12-04 190/week @ 2023-12-11 242/week @ 2023-12-18 119/week @ 2023-12-25 191/week @ 2024-01-01 193/week @ 2024-01-08 177/week @ 2024-01-15 206/week @ 2024-01-22 160/week @ 2024-01-29 162/week @ 2024-02-05 187/week @ 2024-02-12 215/week @ 2024-02-19 215/week @ 2024-02-26 190/week @ 2024-03-04 109/week @ 2024-03-11

759 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