Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read not implemented for &mut [u8] #587

Open
Gip-Gip opened this issue Apr 5, 2024 · 1 comment
Open

Read not implemented for &mut [u8] #587

Gip-Gip opened this issue Apr 5, 2024 · 1 comment

Comments

@Gip-Gip
Copy link

Gip-Gip commented Apr 5, 2024

I get the following error when trying to read from a &mut [u8]

^^ the trait `embedded_io::Read` is not implemented for `[u8]`
    |
    = help: the trait `embedded_io::Read` is implemented for `&[u8]`
    = note: required for `&mut [u8]` to implement `embedded_io::Read`

It appears that the trait is implemented for &[u8] and not &mut [u8]. That currently causes issues with some code I'm working with, and it should be an easy fix so I'll go ahead and fork+pr.

@Dirbaio
Copy link
Member

Dirbaio commented Apr 5, 2024

This is because std::io::Read is not implemented either for &mut [u8]. I just followed that when I wrote that.

I'm curious why is this a problem for you, since it's always possible to convert from &mut [u8] to &[u8].

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

No branches or pull requests

2 participants