Lokathor / tinyvec

Just, really the littlest Vec you could need. So smol.
https://docs.rs/tinyvec
Apache License 2.0
648 stars 49 forks source link

The `array_vec!` macro does not support the array-like `[T; N]` syntax you'd generally expect it to #117

Closed slightlyoutofphase closed 4 years ago

slightlyoutofphase commented 4 years ago

Not a huge deal, but certainly something people might view as what is often called a "papercut" in the Rust community, as that syntax is supported by at least regular vec! and smallvec! as far as "Very Popular Data Structures™" go, and even in staticvec supporting it kind of just seemed like an immediate "must have" to me from day one.

The entire implementation of the staticvec! macro is just this, if it helps at all:

macro_rules! staticvec {
  ($($val:expr),* $(,)*) => {
    $crate::StaticVec::new_from_const_array([$($val),*])
  };
  ($val:expr; $n:expr) => {
    $crate::StaticVec::new_from_const_array([$val; $n])
  };
}
Lokathor commented 4 years ago

At a glance, this looks backwards compatible. If it turns out to be, we should add it for sure.