stm32-rs / stm32-eth

Embedded Ethernet driver in Rust
Apache License 2.0
147 stars 47 forks source link

Make the creation of TxRingEntry and RxRingEntry const #22

Closed thalesfragoso closed 4 years ago

thalesfragoso commented 4 years ago

This allow for people to create RingEntry on a const context, which saves a considerable amount of stack during initialization if having them in a static.

I also left the non const Default implementations for compatibility and also because of https://github.com/rust-lang/rust/issues/49147, which causes the creation of entries a bit cumbersome since Aligned isn't Copy, so users can use default on non const contexts if they want to.

CC @adamgreig

bors[bot] commented 4 years ago

Build succeeded: