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.
This commit is contained in:
Tobin C. Harding 2024-01-22 10:42:32 +11:00
parent 1d00d47b32
commit f317d87ee6
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 2 additions and 2 deletions

View File

@ -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<u8>, limit: u64) -> Result<usize> {
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<u8>) -> Result<usize> {
let mut read: usize = 0;