Skip to content

Commit b6a28dc

Browse files
authored
Bump rand_core to v0.10.0-rc-6 (#787)
- Renames `(Try)RngCore` => `(Try)Rng` - Replace use of `unwrap_err` in example with `UnwrapErr`
1 parent 22082f2 commit b6a28dc

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "getrandom"
3-
version = "0.4.0-rc.0"
3+
version = "0.4.0-rc.1"
44
edition = "2024"
55
rust-version = "1.85" # Sync tests.yml and README.md.
66
authors = ["The Rand Project Developers"]
@@ -37,7 +37,7 @@ sys_rng = ["dep:rand_core"]
3737

3838
[dependencies]
3939
cfg-if = "1"
40-
rand_core = { version = "0.10.0-rc-3", optional = true }
40+
rand_core = { version = "0.10.0-rc-6", optional = true }
4141

4242
# getrandom / linux_android_with_fallback
4343
[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(all(target_os = "linux", target_env = ""), getrandom_backend = "custom", getrandom_backend = "linux_raw", getrandom_backend = "rdrand", getrandom_backend = "rndr"))))'.dependencies]

src/sys_rng.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
use crate::Error;
2-
use rand_core::{TryCryptoRng, TryRngCore};
2+
use rand_core::{TryCryptoRng, TryRng};
33

4-
/// A [`TryRngCore`] interface over the system's preferred random number source
4+
/// A [`TryRng`] interface over the system's preferred random number source
55
///
66
/// This is a zero-sized struct. It can be freely constructed with just `SysRng`.
77
///
88
/// This struct is also available as [`rand::rngs::SysRng`] when using [rand].
99
///
1010
/// # Usage example
1111
///
12-
/// `SysRng` implements [`TryRngCore`]:
12+
/// `SysRng` implements [`TryRng`]:
1313
/// ```
14-
/// use getrandom::{rand_core::TryRngCore, SysRng};
14+
/// use getrandom::{rand_core::TryRng, SysRng};
1515
///
1616
/// let mut key = [0u8; 32];
1717
/// SysRng.try_fill_bytes(&mut key).unwrap();
1818
/// ```
1919
///
20-
/// Using it as an [`RngCore`] is possible using [`TryRngCore::unwrap_err`]:
20+
/// Using it as an [`Rng`] is possible using [`UnwrapErr`]:
2121
/// ```
22-
/// use getrandom::rand_core::{TryRngCore, RngCore};
22+
/// use getrandom::rand_core::{Rng, UnwrapErr};
2323
/// use getrandom::SysRng;
2424
///
25-
/// let mut rng = SysRng.unwrap_err();
25+
/// let mut rng = UnwrapErr(SysRng);
2626
/// let random_u64 = rng.next_u64();
2727
/// ```
2828
///
2929
/// [rand]: https://crates.io/crates/rand
3030
/// [`rand::rngs::SysRng`]: https://docs.rs/rand/latest/rand/rngs/struct.SysRng.html
31-
/// [`RngCore`]: rand_core::RngCore
31+
/// [`Rng`]: rand_core::Rng
3232
#[derive(Clone, Copy, Debug, Default)]
3333
pub struct SysRng;
3434

35-
impl TryRngCore for SysRng {
35+
impl TryRng for SysRng {
3636
type Error = Error;
3737

3838
#[inline]

tests/sys_rng.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "sys_rng")]
22

33
use getrandom::SysRng;
4-
use getrandom::rand_core::TryRngCore;
4+
use getrandom::rand_core::TryRng;
55

66
#[test]
77
fn test_sys_rng() {

0 commit comments

Comments
 (0)