rust-embedded / embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems
Apache License 2.0
1.95k stars 197 forks source link

Missing std io error impls for `ReadExactError` & `WriteAllError` #475

Closed MabezDev closed 1 year ago

MabezDev commented 1 year ago

Currently depends on changes from https://github.com/rust-embedded/embedded-hal/pull/472.

I don't think the move of to_std_error to embedded-io will cause any stabilization concerns, it seems unlikely that that signature would change. If it is, I can make this hidden within embedded-io and we can duplicate the function for the adapters crate.

Dirbaio commented 1 year ago

with the From impls I added, to_std_error becomes 1 line: std::io::Error::new(err.kind().into(), format!("{:?}", err)) . (I should've done that change lol)

With that I think it's less critical to share it, I'd rather not expose it as public API.

MabezDev commented 1 year ago

Ah, good point! Changed :).

Dirbaio commented 1 year ago

Incorporated into #472. Thank you! :)