From ddb027231f66591dd677926ef3117a912bec1d24 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Wed, 29 Jan 2025 14:59:47 +0100 Subject: [PATCH] shred: adapt to API changes of rand --- src/uu/shred/src/shred.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index 763d6cfd4..9107bcde5 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -176,7 +176,7 @@ impl BytesWriter { fn from_pass_type(pass: &PassType) -> Self { match pass { PassType::Random => Self::Random { - rng: StdRng::from_entropy(), + rng: StdRng::from_os_rng(), buffer: [0; BLOCK_SIZE], }, PassType::Pattern(pattern) => { @@ -452,7 +452,7 @@ fn wipe_file( for pattern in PATTERNS.into_iter().take(remainder) { pass_sequence.push(PassType::Pattern(pattern)); } - let mut rng = rand::thread_rng(); + let mut rng = rand::rng(); pass_sequence.shuffle(&mut rng); // randomize the order of application let n_random = 3 + n_passes / 10; // Minimum 3 random passes; ratio of 10 after