array_init_macro

Crates.ioarray_init_macro
lib.rsarray_init_macro
version0.1.2
sourcesrc
created_at2022-11-30 10:11:36.958
updated_at2022-11-30 10:26:51.608069
descriptionSimple initialization macro for arrays.
homepage
repositoryhttps://github.com/ramon54321/array_init_macro.git
max_upload_size
id726090
size2,581
Ramon Brand (ramon54321)

documentation

README

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]];
}
Commit count: 8

cargo fmt