hecatia-elegua / bilge

Use bitsized types as if they were a feature of rust.
Apache License 2.0
173 stars 18 forks source link

Implement Binary formatting #46

Closed pickx closed 1 year ago

pickx commented 1 year ago

will close #8

pickx commented 1 year ago

jeez, talk about missing the forest from the trees. instead of using accessors, I'm now bitshifting on the struct's value post-compression. it's more simple that way and I'd imagine it optimizes better.

hecatia-elegua commented 1 year ago

will look at this and the others on saturday! what would it take to move this out into a derive? from a quick glance it looks like it's pretty self-contained? It looks like you got the idea with underscores working? 👀

pickx commented 1 year ago

will look at this and the others on saturday! what would it take to move this out into a derive? from a quick glance it looks like it's pretty self-contained? It looks like you got the idea with underscores working? 👀

thanks! yeah there's no need for a derive here. if you're bored, take a look at the commit history. I slowly stumbled my way into a (hopefully) correct solution.

hecatia-elegua commented 1 year ago

Okay now this is a very good usecase for interactive rebase. like, 2 commits "Add derive(BinaryBits)" and "Adjust examples to use BinaryBits" That will also tell us how github handles it.

pickx commented 1 year ago

Okay now this is a very good usecase for interactive rebase

famous last words