Skip to content

Commit 3a5efeb

Browse files
committed
Move doc(hidden) items to __private module
To clarify that they are not public APIs.
1 parent ac3fa6b commit 3a5efeb

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

async-stream-impl/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl VisitMut for Scrub<'_> {
173173
};
174174
#label
175175
loop {
176-
let #pat = match #crate_path::reexport::next(&mut __pinned).await {
176+
let #pat = match #crate_path::__private::next(&mut __pinned).await {
177177
::core::option::Option::Some(e) => e,
178178
::core::option::Option::None => break,
179179
};
@@ -227,8 +227,8 @@ pub fn stream_inner(input: TokenStream) -> TokenStream {
227227
};
228228

229229
quote!({
230-
let (mut __yield_tx, __yield_rx) = #crate_path::yielder::pair();
231-
#crate_path::AsyncStream::new(__yield_rx, async move {
230+
let (mut __yield_tx, __yield_rx) = #crate_path::__private::yielder::pair();
231+
#crate_path::__private::AsyncStream::new(__yield_rx, async move {
232232
#dummy_yield
233233
#(#stmts)*
234234
})
@@ -261,8 +261,8 @@ pub fn try_stream_inner(input: TokenStream) -> TokenStream {
261261
};
262262

263263
quote!({
264-
let (mut __yield_tx, __yield_rx) = #crate_path::yielder::pair();
265-
#crate_path::AsyncStream::new(__yield_rx, async move {
264+
let (mut __yield_tx, __yield_rx) = #crate_path::__private::yielder::pair();
265+
#crate_path::__private::AsyncStream::new(__yield_rx, async move {
266266
#dummy_yield
267267
#(#stmts)*
268268
})

async-stream/src/lib.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,7 @@
158158
159159
mod async_stream;
160160
mod next;
161-
#[doc(hidden)]
162-
pub mod yielder;
163-
164-
// Used by the macro, but not intended to be accessed publicly.
165-
#[doc(hidden)]
166-
pub use crate::async_stream::AsyncStream;
167-
168-
#[doc(hidden)]
169-
pub use async_stream_impl;
161+
mod yielder;
170162

171163
/// Asynchronous stream
172164
///
@@ -198,7 +190,7 @@ pub use async_stream_impl;
198190
#[macro_export]
199191
macro_rules! stream {
200192
($($tt:tt)*) => {
201-
$crate::async_stream_impl::stream_inner!(($crate) $($tt)*)
193+
$crate::__private::stream_inner!(($crate) $($tt)*)
202194
}
203195
}
204196

@@ -234,12 +226,17 @@ macro_rules! stream {
234226
#[macro_export]
235227
macro_rules! try_stream {
236228
($($tt:tt)*) => {
237-
$crate::async_stream_impl::try_stream_inner!(($crate) $($tt)*)
229+
$crate::__private::try_stream_inner!(($crate) $($tt)*)
238230
}
239231
}
240232

233+
// Not public API.
241234
#[doc(hidden)]
242-
pub mod reexport {
243-
#[doc(hidden)]
235+
pub mod __private {
236+
pub use crate::async_stream::AsyncStream;
244237
pub use crate::next::next;
238+
pub use async_stream_impl::{stream_inner, try_stream_inner};
239+
pub mod yielder {
240+
pub use crate::yielder::pair;
241+
}
245242
}

async-stream/src/yielder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(missing_docs)]
2+
13
use std::cell::Cell;
24
use std::future::Future;
35
use std::marker::PhantomData;

0 commit comments

Comments
 (0)