NULLx76 / ringbuffer

A fixed-size circular buffer written in Rust.
https://crates.io/crates/ringbuffer
MIT License
95 stars 20 forks source link

Added compile time zero and power of two check #76

Closed zimward closed 1 year ago

zimward commented 1 year ago

Implements #61 It's still a bit hacky but the compile message should be comprehensive enough that it's obvious whats wrong and removes a unnecessary possibility of panic!, which is especially nice for those of us who work on embedded systems where panic! messages are often unrecoverable.

The only real issue with it is that it breaks the tests for it. I will look into using compiletest_rs to fix this.

jdonszelmann commented 1 year ago

Closing in favor of #78