proc_strarray 1.0.0

Create const u8 array from str literal
Documentation

Procedural macro "str" to const [ u8; _ ]

MIT/Apache License Crates.io Version Crates.io MSRV Crates.io Downloads

Procedural macro proc_strarray::make_array creates const u8 array from str literal.

Usage

    // This code will create const array of u8 named STRU from content of "stru" str literal.
    use proc_strarray::make_array;
    make_array!(STRU, "stru");
    // check if newly created array have length 4 and first character is 's'
    assert_eq!(STRU.len(), 4);
    assert_eq!(STRU[0], 's' as u8);