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:
parent
1d00d47b32
commit
f317d87ee6
|
@ -67,7 +67,7 @@ pub trait Read {
|
||||||
///
|
///
|
||||||
/// Similar to `std::io::Read::read_to_end` but with the DOS protection.
|
/// Similar to `std::io::Read::read_to_end` but with the DOS protection.
|
||||||
#[doc(alias = "read_to_end")]
|
#[doc(alias = "read_to_end")]
|
||||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
#[cfg(feature = "alloc")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn read_to_limit(&mut self, buf: &mut Vec<u8>, limit: u64) -> Result<usize> {
|
fn read_to_limit(&mut self, buf: &mut Vec<u8>, limit: u64) -> Result<usize> {
|
||||||
self.take(limit).read_to_end(buf)
|
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> {
|
impl<'a, R: Read + ?Sized> Take<'a, R> {
|
||||||
/// Reads all bytes until EOF from the underlying reader into `buf`.
|
/// Reads all bytes until EOF from the underlying reader into `buf`.
|
||||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
#[cfg(feature = "alloc")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
|
pub fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
|
||||||
let mut read: usize = 0;
|
let mut read: usize = 0;
|
||||||
|
|
Loading…
Reference in New Issue