diff --git a/src/libboard_artiq/src/drtioaux.rs b/src/libboard_artiq/src/drtioaux.rs index 4e3deaa..78e21f3 100644 --- a/src/libboard_artiq/src/drtioaux.rs +++ b/src/libboard_artiq/src/drtioaux.rs @@ -1,7 +1,7 @@ use core::slice; use crc; -use core_io::Error as IoError; +use core_io::{ErrorKind as IoErrorKind, Error as IoError}; use io::{proto::ProtoRead, proto::ProtoWrite, Cursor}; use mem::mem::DRTIOAUX_MEM; @@ -84,7 +84,7 @@ pub fn recv(linkno: u8) -> Result, Error> { receive(linkno, |buffer| { if buffer.len() < 8 { - return Err(IoError::UnexpectedEnd.into()) + return Err(IoError::new(IoErrorKind::UnexpectedEof, "Unexpected end").into()) } let mut reader = Cursor::new(buffer); diff --git a/src/libboard_artiq/src/drtioaux_proto.rs b/src/libboard_artiq/src/drtioaux_proto.rs index 53c1745..7d13785 100644 --- a/src/libboard_artiq/src/drtioaux_proto.rs +++ b/src/libboard_artiq/src/drtioaux_proto.rs @@ -1,6 +1,6 @@ -use core_io::Error as IoError; +use core_io::{Write, Read, Error as IoError}; -use io::proto::{ProtoWrite as Write, ProtoRead as Read}; +use io::proto::{ProtoWrite, ProtoRead}; #[derive(Debug)] pub enum Error { @@ -14,14 +14,6 @@ impl From for Error { } } -/* Why does this not work?! -impl From for Error { - fn from(value: Write::WriteError) -> Error { - Error::Io(value) - } -}*/ - - #[derive(PartialEq, Debug)] pub enum Packet { EchoRequest,