First time I've added methods to an enum. Went about as well as I hoped for :D https://github.com/datrs/sparse-bitfield/pull/6 …
-
Show this thread
-
yosh Retweeted Michael Grunder
When taking https://twitter.com/grumi78/status/1004383484251525120 … into consideration, the underlying result is pretty cool. We use the #[inline] attribute + an empty enum. This means that the code is probably going to be compiled to a single branch on a byte, which is pretty much the most efficient it can be
yosh added,
1 reply 0 retweets 2 likesShow this thread -
All of which is quite nice for something that reads so easily: if bitfield.set(0, true).is_changed() { // do stuff here }
1 reply 0 retweets 1 likeShow this thread
Really happy the way this change turned out! https://github.com/datrs/hypercore/commit/4f9aa51b168637521fef1c24a7b95040cb662fba …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.