array_init_macro 0.1.2

Simple initialization macro for arrays.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 2.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 105.48 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • CathodeCube/array_init_macro
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ramon54321

Array Init Macro

Provides a simple macro to initialize an array given a type, size and value.

Crate on Crates.io

use array_init_macro::arr;

fn main() {
    // [1, 1, 1, 1]
    let array0 = arr![u8; 4; 1];
    
    // [1, 1, 1, 1]
    let array1 = arr![u32; 4; 1];

    // [Vec[1, 2], Vec[1, 2], Vec[1, 2], Vec[1, 2]]
    let array2 = arr![Vec<u8>; 4; vec![1, 2]];
}