I have some code that manipulates small vectors (<100 elements) and needs to pass around subsets of the elements of those vectors a lot in a high-performance way. It occurs to me that you can represent a subset of the elements of a vector via a bit set, where a "1" bit means the element is included in the subset and a "0" means the element is not included.
I really like the EnumSet crate for doing similar things to this, and what I want is basically just an EnumSet over the integers 0-100. Is there an existing crate that provides this functionality? Thanks!
If the length of your bitvec is not const (so you can’t use BitArray) but is usually less than 63, then smallbitvec might be a good fit. This is a very small library used in Servo and Firefox.