rust-embedded / embedded-dma

Apache License 2.0
35 stars 12 forks source link

Rename StaticXXBuffer to XXBuffer #10

Closed Dirbaio closed 2 years ago

Dirbaio commented 3 years ago

Following up on conversations from Matrix.

In 99.9% of the cases HALs should use the StaticXXBuffer traits. However, historically, many HAL implementors have gotten it wrong. Reasons:

Their original purpose was to allow using (unsafely) non-'static buffers with DMA functions. However, the newer StaticXXBuffer make this possible. They don't have a : 'static bound, but are implemented for 'static buffers only. This allows users to (unsafely) "escape" the requirement by unsafe impling StaticXXBuffer for their types.

Therefore IMO having two sets of traits isn't worth the confusion it adds.

Proposal:

This is a breaking change of course.

thalesfragoso commented 3 years ago

Just passing by to say that I agree with this reasoning.