Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions library/core/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ pub use self::error::ErrorKind;
pub use self::error::RawOsError;
#[unstable(feature = "core_io", issue = "154046")]
pub use self::util::{Chain, Empty, Repeat, Sink, Take, empty, repeat, sink};
#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
pub use self::util::{chain, take};
18 changes: 0 additions & 18 deletions library/core/src/io/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub const fn sink() -> Sink {
/// [`chain`]: ../../std/io/trait.Read.html#method.chain
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
#[non_exhaustive]
pub struct Chain<T, U> {
#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
Expand Down Expand Up @@ -224,14 +223,6 @@ impl<T, U> Chain<T, U> {
}
}

#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
#[must_use]
#[inline]
pub const fn chain<T, U>(first: T, second: U) -> Chain<T, U> {
Chain { first, second, done_first: false }
}

/// Reader adapter which limits the bytes read from an underlying reader.
///
/// This struct is generally created by calling [`take`] on a reader.
Expand All @@ -240,7 +231,6 @@ pub const fn chain<T, U>(first: T, second: U) -> Chain<T, U> {
/// [`take`]: ../../std/io/trait.Read.html#method.take
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
#[non_exhaustive]
pub struct Take<T> {
#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
Expand Down Expand Up @@ -405,11 +395,3 @@ impl<T> Take<T> {
&mut self.inner
}
}

#[doc(hidden)]
#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")]
#[must_use]
#[inline]
pub const fn take<T>(inner: T, limit: u64) -> Take<T> {
Take { inner, limit, len: limit }
}
4 changes: 2 additions & 2 deletions library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ pub trait Read {
where
Self: Sized,
{
core::io::chain(self, next)
Chain { first: self, second: next, done_first: false }
}

/// Creates an adapter which will read at most `limit` bytes from it.
Expand Down Expand Up @@ -1223,7 +1223,7 @@ pub trait Read {
where
Self: Sized,
{
core::io::take(self, limit)
Take { inner: self, len: limit, limit }
}

/// Read and return a fixed array of bytes from this source.
Expand Down
Loading