theangryangel / insim.rs

Crates for working with the Live For Speed Racing Simulator
MIT License
6 stars 1 forks source link

Do we really need bitflags? Can we simplify? #124

Closed theangryangel closed 9 months ago

theangryangel commented 9 months ago

bitflags is great: stable, maintained, small.

But our usage is relatively simple and could easily implement the same functionality in equal or fewer LoC, and maintain a broadly similar API.

However, the rest of the insim crate has opted towards abstraction and simplification.

The most obvious and simple implementation would be to parse at encode and decode of a packet to a series of bools.

Does that work? Is that too abstract?

theangryangel commented 9 months ago

Right now the answer is that it’s not worth the time to swap out because:

The only thing I don’t enjoy about bitflags right now is the way it serialises with serde but that can be dealt with.