Skip to content

Commit 8ae52a2

Browse files
committed
doc: Tweak link names for RngCore methods
1 parent 0d0bb91 commit 8ae52a2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

rand_core/src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,22 @@ pub trait RngCore {
141141
///
142142
/// RNGs must implement at least one method from this trait directly. In
143143
/// the case this method is not implemented directly, it can be implemented
144-
/// using `self.next_u64() as u32` or via
145-
/// [`fill_bytes`](impls::next_u32_via_fill).
144+
/// using `self.next_u64() as u32` or via [`impls::next_u32_via_fill`].
146145
fn next_u32(&mut self) -> u32;
147146

148147
/// Return the next random `u64`.
149148
///
150149
/// RNGs must implement at least one method from this trait directly. In
151150
/// the case this method is not implemented directly, it can be implemented
152-
/// via [`next_u32`](impls::next_u64_via_u32) or via
153-
/// [`fill_bytes`](impls::next_u64_via_fill).
151+
/// via [`impls::next_u64_via_u32`] or via [`impls::next_u64_via_fill`].
154152
fn next_u64(&mut self) -> u64;
155153

156154
/// Fill `dest` with random data.
157155
///
158156
/// RNGs must implement at least one method from this trait directly. In
159157
/// the case this method is not implemented directly, it can be implemented
160-
/// via [`next_u*`](impls::fill_bytes_via_next) or
161-
/// via [`try_fill_bytes`](RngCore::try_fill_bytes); if this generator can
158+
/// via [`impls::fill_bytes_via_next`] or
159+
/// via [`RngCore::try_fill_bytes`]; if this generator can
162160
/// fail the implementation must choose how best to handle errors here
163161
/// (e.g. panic with a descriptive message or log a warning and retry a few
164162
/// times).
@@ -176,12 +174,10 @@ pub trait RngCore {
176174
/// by external (true) RNGs (e.g. `OsRng`) which can fail. It may be used
177175
/// directly to generate keys and to seed (infallible) PRNGs.
178176
///
179-
/// Other than error handling, this method is identical to [`fill_bytes`];
177+
/// Other than error handling, this method is identical to [`RngCore::fill_bytes`];
180178
/// thus this may be implemented using `Ok(self.fill_bytes(dest))` or
181179
/// `fill_bytes` may be implemented with
182180
/// `self.try_fill_bytes(dest).unwrap()` or more specific error handling.
183-
///
184-
/// [`fill_bytes`]: RngCore::fill_bytes
185181
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>;
186182
}
187183

0 commit comments

Comments
 (0)