Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Make BlockDevice depend on Write<u8> to remove mutable reference on write buffer #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fry
Copy link

@fry fry commented Nov 3, 2020

Hi!

I ran into the issue of write_bytes taking a &mut [u8], because the Transfer trait requires it.
The nRF52-hal SPI drivers appear to implement Write<_> at least, so I made the BlockDevice trait depend on that so write_bytes can be non-mutable.

This required some reorganisation of the Error type to receive the SPI Error type, as both Transfer and Write have their own associated Error type.

I might've missed some implications of depending on the Write trait, as I assumed that anything that implements Transfer, should have no problem implementing Write.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant