firmware: rename io::Error::{UnexpectedEof→UnexpectedEnd}.

We don't even have files.
This commit is contained in:
whitequark 2018-05-15 08:27:45 +00:00
parent ce0593315b
commit 140ca729aa
4 changed files with 6 additions and 6 deletions

View File

@ -129,7 +129,7 @@ extern fn rpc_send_async(service: u32, tag: CSlice<u8>, data: *const *const ())
}; };
io::ProtoWrite::write_u32(&mut slice, length as u32) io::ProtoWrite::write_u32(&mut slice, length as u32)
}).unwrap_or_else(|err| { }).unwrap_or_else(|err| {
assert!(err == io::Error::UnexpectedEof); assert!(err == io::Error::UnexpectedEnd);
while !rpc_queue::empty() {} while !rpc_queue::empty() {}
send(&RpcSend { send(&RpcSend {

View File

@ -26,7 +26,7 @@ pub type Result<T, E> = result::Result<T, Error<E>>;
#[derive(Fail, Debug, Clone, PartialEq)] #[derive(Fail, Debug, Clone, PartialEq)]
pub enum Error<T> { pub enum Error<T> {
#[fail(display = "unexpected end of stream")] #[fail(display = "unexpected end of stream")]
UnexpectedEof, UnexpectedEnd,
#[fail(display = "unrecognized input")] #[fail(display = "unrecognized input")]
Unrecognized, Unrecognized,
#[fail(display = "{}", _0)] #[fail(display = "{}", _0)]
@ -51,7 +51,7 @@ pub trait Read {
while !buf.is_empty() { while !buf.is_empty() {
let read_bytes = self.read(buf)?; let read_bytes = self.read(buf)?;
if read_bytes == 0 { if read_bytes == 0 {
return Err(Error::UnexpectedEof) return Err(Error::UnexpectedEnd)
} }
buf = &mut { buf }[read_bytes..]; buf = &mut { buf }[read_bytes..];
@ -85,7 +85,7 @@ pub trait Write {
while buf.len() > 0 { while buf.len() > 0 {
let written_bytes = self.write(buf)?; let written_bytes = self.write(buf)?;
if written_bytes == 0 { if written_bytes == 0 {
return Err(Error::UnexpectedEof) return Err(Error::UnexpectedEnd)
} }
buf = &buf[written_bytes..]; buf = &buf[written_bytes..];

View File

@ -165,7 +165,7 @@ pub fn thread(io: Io) {
let mut stream = TcpStream::from_handle(&io, stream); let mut stream = TcpStream::from_handle(&io, stream);
match worker(&io, &mut stream) { match worker(&io, &mut stream) {
Ok(()) => (), Ok(()) => (),
Err(io::Error::UnexpectedEof) => (), Err(io::Error::UnexpectedEnd) => (),
Err(err) => error!("aborted: {}", err) Err(err) => error!("aborted: {}", err)
} }
}); });

View File

@ -674,7 +674,7 @@ pub fn thread(io: Io) {
let mut stream = TcpStream::from_handle(&io, stream); let mut stream = TcpStream::from_handle(&io, stream);
match host_kernel_worker(&io, &mut stream, &mut *congress) { match host_kernel_worker(&io, &mut stream, &mut *congress) {
Ok(()) => (), Ok(()) => (),
Err(io::Error::UnexpectedEof) => { Err(io::Error::UnexpectedEnd) => {
info!("connection closed"); info!("connection closed");
} }
Err(io::Error::Other(ref err)) Err(io::Error::Other(ref err))