Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Oct 30, 2024
1 parent 165de66 commit a32c079
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rand_trng/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ thread_local!(
/// A reference to the thread-local generator.
///
/// This type is a reference to a lazily-initialized thread-local generator.
/// An instance can be obtained via [`rand::rng()`][crate::rng()] or via
/// [`ThreadRng::default()`].
/// The handle cannot be passed between threads (is not `Send` or `Sync`).
/// An instance can be obtained via [`ThreadRng::new()`] or [`ThreadRng::default()`].
/// The handle cannot be passed between threads (is not [`Send`] or [`Sync`]).
///
/// # Example
///
Expand Down Expand Up @@ -137,15 +136,11 @@ thread_local!(
/// [`OsRng`]: rand_core::OsRng
#[derive(Clone)]
pub struct ThreadRng {
// Rc is explicitly !Send and !Sync
rng: Rc<UnsafeCell<InnerState>>,
}

impl ThreadRng {
/// Get [`ThreadRng`] instance.
///
/// Note that this method usually returns instance which references already initialized
/// thread-local state.
/// Create a reference to the thread-local generator.
pub fn new() -> Self {
Default::default()
}
Expand Down

0 comments on commit a32c079

Please sign in to comment.