Skip to content

Commit 9d28f03

Browse files
authored
simple-cipher: upgrade rand to 0.9 (#2055)
1 parent 02dce7d commit 9d28f03

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

exercises/practice/simple-cipher/.meta/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use rand::Rng;
22

33
pub fn encode_random(s: &str) -> (String, String) {
4-
let mut r = rand::thread_rng();
4+
let mut r = rand::rng();
55
let mut key = String::new();
66
for _ in 0..100 {
7-
key.push(char::from(b'a' + r.gen_range(0..26)));
7+
key.push(char::from(b'a' + r.random_range(0..26)));
88
}
99
let encoded = encode(&key, s);
1010
(key, encoded.unwrap())

exercises/practice/simple-cipher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2024"
77
# The full list of available libraries is here:
88
# https://github.com/exercism/rust-test-runner/blob/main/local-registry/Cargo.toml
99
[dependencies]
10-
rand = "0.8"
10+
rand = "0.9"

0 commit comments

Comments
 (0)