File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,8 @@ thread_local!(
75
75
/// A reference to the thread-local generator.
76
76
///
77
77
/// 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`]).
81
80
///
82
81
/// # Example
83
82
///
@@ -137,15 +136,11 @@ thread_local!(
137
136
/// [`OsRng`]: rand_core::OsRng
138
137
#[ derive( Clone ) ]
139
138
pub struct ThreadRng {
140
- // Rc is explicitly !Send and !Sync
141
139
rng : Rc < UnsafeCell < InnerState > > ,
142
140
}
143
141
144
142
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.
149
144
pub fn new ( ) -> Self {
150
145
Default :: default ( )
151
146
}
You can’t perform that action at this time.
0 commit comments