diff --git a/library/core/src/io/mod.rs b/library/core/src/io/mod.rs index 822b24a9b4691..b749af56bd311 100644 --- a/library/core/src/io/mod.rs +++ b/library/core/src/io/mod.rs @@ -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}; diff --git a/library/core/src/io/util.rs b/library/core/src/io/util.rs index 232e388433fb0..8e2e93da18f8d 100644 --- a/library/core/src/io/util.rs +++ b/library/core/src/io/util.rs @@ -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 { #[doc(hidden)] #[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")] @@ -224,14 +223,6 @@ impl Chain { } } -#[doc(hidden)] -#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")] -#[must_use] -#[inline] -pub const fn chain(first: T, second: U) -> Chain { - 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. @@ -240,7 +231,6 @@ pub const fn chain(first: T, second: U) -> Chain { /// [`take`]: ../../std/io/trait.Read.html#method.take #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] -#[non_exhaustive] pub struct Take { #[doc(hidden)] #[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")] @@ -405,11 +395,3 @@ impl Take { &mut self.inner } } - -#[doc(hidden)] -#[unstable(feature = "core_io_internals", reason = "exposed only for libstd", issue = "none")] -#[must_use] -#[inline] -pub const fn take(inner: T, limit: u64) -> Take { - Take { inner, limit, len: limit } -} diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 43a6a18ac2c3f..885aaa87a1088 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -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. @@ -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.