libio: read/write traits from libio not core_io

This commit is contained in:
mwojcik 2021-08-26 14:59:04 +02:00
parent 10cbea72a2
commit cb3f0a404c
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
use {Read, Write};
use ::{Read, Write};
#[derive(Debug, Clone)]
pub struct Cursor<T> {
@ -50,7 +50,7 @@ impl<T: AsRef<[u8]>> Read for Cursor<T> {
}
}
impl<'a> Write for Cursor<&'a mut [u8]> {
impl Write for Cursor<&mut [u8]> {
type WriteError = !;
type FlushError = !;

View File

@ -3,7 +3,7 @@ use byteorder::{ByteOrder, NativeEndian};
use alloc::vec;
use alloc::string::String;
use core_io::{Read, Write, Error as IoError};
use ::{Read, Write, Error as IoError};
#[allow(dead_code)]
#[derive(Debug, Clone, PartialEq)]
@ -142,7 +142,7 @@ pub trait ProtoWrite {
}
impl<T> ProtoRead for T where T: Read + ?Sized {
type ReadError = IoError;
type ReadError = IoError<T::ReadError>;
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::ReadError> {
T::read_exact(self, buf)
@ -150,7 +150,7 @@ impl<T> ProtoRead for T where T: Read + ?Sized {
}
impl<T> ProtoWrite for T where T: Write + ?Sized {
type WriteError = IoError;
type WriteError = IoError<T::WriteError>;
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::WriteError> {
T::write_all(self, buf)