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

Make code DRYer #101

Closed Soveu closed 4 years ago

Soveu commented 4 years ago

Most of TinyVec code looks like this

pub fn whatever(self, args) -> ReturnType {
  match self {
    Self::Inline(i) => i.whatever(args),
    Self::Heap(h) => h.whatever(args),
  }
}

While coding TInyBitVec I made a macro that produces this kind of code automatically

If we are interested, I could port it here

Lokathor commented 4 years ago

yeah that seems useful