Skip to content

Instantly share code, notes, and snippets.

@MingweiSamuel
Created July 1, 2021 01:20
Show Gist options
  • Save MingweiSamuel/3d6542a8dde4546a19d98b392237514b to your computer and use it in GitHub Desktop.
Save MingweiSamuel/3d6542a8dde4546a19d98b392237514b to your computer and use it in GitHub Desktop.

Revisions

  1. MingweiSamuel created this gist Jul 1, 2021.
    9 changes: 9 additions & 0 deletions arr.rs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    macro_rules! arr {
    (
    $( #[$attr:meta] )*
    $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr
    ) => {
    $( #[$attr] )*
    $v $id $name: [$ty; $value.len()] = $value;
    }
    }