From a32c079ba477387d625eb4d54adf181539597503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Wed, 30 Oct 2024 15:21:02 +0300 Subject: [PATCH] tweak --- rand_trng/src/lib.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/rand_trng/src/lib.rs b/rand_trng/src/lib.rs index 15237f170c..ea02dfd0f3 100644 --- a/rand_trng/src/lib.rs +++ b/rand_trng/src/lib.rs @@ -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 /// @@ -137,15 +136,11 @@ thread_local!( /// [`OsRng`]: rand_core::OsRng #[derive(Clone)] pub struct ThreadRng { - // Rc is explicitly !Send and !Sync rng: Rc>, } 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() }