Skip to content

Commit a32c079

Browse files
committed
tweak
1 parent 165de66 commit a32c079

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

rand_trng/src/lib.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ thread_local!(
7575
/// A reference to the thread-local generator.
7676
///
7777
/// This type is a reference to a lazily-initialized thread-local generator.
78-
/// An instance can be obtained via [`rand::rng()`][crate::rng()] or via
79-
/// [`ThreadRng::default()`].
80-
/// The handle cannot be passed between threads (is not `Send` or `Sync`).
78+
/// An instance can be obtained via [`ThreadRng::new()`] or [`ThreadRng::default()`].
79+
/// The handle cannot be passed between threads (is not [`Send`] or [`Sync`]).
8180
///
8281
/// # Example
8382
///
@@ -137,15 +136,11 @@ thread_local!(
137136
/// [`OsRng`]: rand_core::OsRng
138137
#[derive(Clone)]
139138
pub struct ThreadRng {
140-
// Rc is explicitly !Send and !Sync
141139
rng: Rc<UnsafeCell<InnerState>>,
142140
}
143141

144142
impl ThreadRng {
145-
/// Get [`ThreadRng`] instance.
146-
///
147-
/// Note that this method usually returns instance which references already initialized
148-
/// thread-local state.
143+
/// Create a reference to the thread-local generator.
149144
pub fn new() -> Self {
150145
Default::default()
151146
}

0 commit comments

Comments
 (0)