From f317d87ee61ef3a48a834fc3397e17cb4064ba95 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 22 Jan 2024 10:42:32 +1100 Subject: [PATCH] io: Enable "alloc" from "std" As is customary in our crates, enable the "alloc" feature from the "std" feature. This allows simplifying the feature gating. --- io/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/src/lib.rs b/io/src/lib.rs index f397ba2f..55ee4a56 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -67,7 +67,7 @@ pub trait Read { /// /// Similar to `std::io::Read::read_to_end` but with the DOS protection. #[doc(alias = "read_to_end")] - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] #[inline] fn read_to_limit(&mut self, buf: &mut Vec, limit: u64) -> Result { self.take(limit).read_to_end(buf) @@ -97,7 +97,7 @@ pub struct Take<'a, R: Read + ?Sized> { impl<'a, R: Read + ?Sized> Take<'a, R> { /// Reads all bytes until EOF from the underlying reader into `buf`. - #[cfg(any(feature = "alloc", feature = "std"))] + #[cfg(feature = "alloc")] #[inline] pub fn read_to_end(&mut self, buf: &mut Vec) -> Result { let mut read: usize = 0;