From 97a0132f156d376dcbfd783fc0c1144859dba653 Mon Sep 17 00:00:00 2001 From: occheung Date: Thu, 22 Jul 2021 16:25:13 +0800 Subject: [PATCH] libio: update alloc type path --- artiq/firmware/libio/cursor.rs | 2 +- artiq/firmware/libio/lib.rs | 2 +- artiq/firmware/libio/proto.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/artiq/firmware/libio/cursor.rs b/artiq/firmware/libio/cursor.rs index b820bdddc..85ff478fe 100644 --- a/artiq/firmware/libio/cursor.rs +++ b/artiq/firmware/libio/cursor.rs @@ -69,7 +69,7 @@ impl<'a> Write for Cursor<&'a mut [u8]> { } #[cfg(feature = "alloc")] -impl Write for Cursor<::alloc::Vec> { +impl Write for Cursor<::alloc::vec::Vec> { type WriteError = !; type FlushError = !; diff --git a/artiq/firmware/libio/lib.rs b/artiq/firmware/libio/lib.rs index b10c41345..235fd82c0 100644 --- a/artiq/firmware/libio/lib.rs +++ b/artiq/firmware/libio/lib.rs @@ -131,7 +131,7 @@ impl<'a> Write for &'a mut [u8] { } #[cfg(feature = "alloc")] -impl<'a> Write for alloc::Vec { +impl<'a> Write for alloc::vec::Vec { type WriteError = !; type FlushError = !; diff --git a/artiq/firmware/libio/proto.rs b/artiq/firmware/libio/proto.rs index 3df4a04aa..88b010e71 100644 --- a/artiq/firmware/libio/proto.rs +++ b/artiq/firmware/libio/proto.rs @@ -1,5 +1,5 @@ #[cfg(feature = "alloc")] -use {core::str::Utf8Error, alloc::String}; +use {core::str::Utf8Error, alloc::string::String}; use byteorder::{ByteOrder, NetworkEndian}; use ::{Read, Write, Error as IoError}; @@ -53,7 +53,7 @@ pub trait ProtoRead { #[cfg(feature = "alloc")] #[inline] - fn read_bytes(&mut self) -> Result<::alloc::Vec, Self::ReadError> { + fn read_bytes(&mut self) -> Result<::alloc::vec::Vec, Self::ReadError> { let length = self.read_u32()?; let mut value = vec![0; length as usize]; self.read_exact(&mut value)?; @@ -62,7 +62,7 @@ pub trait ProtoRead { #[cfg(feature = "alloc")] #[inline] - fn read_string(&mut self) -> Result<::alloc::String, ReadStringError> { + fn read_string(&mut self) -> Result<::alloc::string::String, ReadStringError> { let bytes = self.read_bytes().map_err(ReadStringError::Other)?; String::from_utf8(bytes).map_err(|err| ReadStringError::Utf8(err.utf8_error())) }