std-embedded-nal 0.4.0

Implementation of the `embedded-nal` traits for large devices that support the standard library
Documentation
1
2
3
4
5
6
7
8
9
10
use embedded_nal::nb;
use std::io;

pub(crate) fn to_nb(e: io::Error) -> nb::Error<io::Error> {
    use io::ErrorKind::{TimedOut, WouldBlock};
    match e.kind() {
        WouldBlock | TimedOut => nb::Error::WouldBlock,
        _ => e.into(),
    }
}