Skip to content

Commit 13a83fe

Browse files
taiki-ecramertj
authored andcommitted
Minimize re-exports from rand
1 parent bd8dafa commit 13a83fe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

futures-select-macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub fn select(input: TokenStream) -> TokenStream {
262262
#( #poll_functions )*
263263

264264
let mut __select_arr = [#( #variant_names ),*];
265-
<[_] as #rand_crate::prelude::SliceRandom>::shuffle(
265+
<[_] as #rand_crate::SliceRandom>::shuffle(
266266
&mut __select_arr,
267267
&mut #rand_crate::thread_rng(),
268268
);

futures-util/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ pub use self::async_await::*;
3636
#[cfg(feature = "async-await")]
3737
#[doc(hidden)]
3838
pub mod rand_reexport { // used by select!
39-
pub use rand::*;
39+
pub use rand::{prelude::SliceRandom, thread_rng};
40+
41+
// HACK: Define dummy `ThreadRng` to avoid `intra_doc_link_resolution_failure` warning.
42+
#[allow(missing_debug_implementations)]
43+
#[doc(hidden)]
44+
pub struct ThreadRng {}
4045
}
4146

4247
#[doc(hidden)]

0 commit comments

Comments
 (0)