We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02dce7d commit 9d28f03Copy full SHA for 9d28f03
2 files changed
exercises/practice/simple-cipher/.meta/example.rs
@@ -1,10 +1,10 @@
1
use rand::Rng;
2
3
pub fn encode_random(s: &str) -> (String, String) {
4
- let mut r = rand::thread_rng();
+ let mut r = rand::rng();
5
let mut key = String::new();
6
for _ in 0..100 {
7
- key.push(char::from(b'a' + r.gen_range(0..26)));
+ key.push(char::from(b'a' + r.random_range(0..26)));
8
}
9
let encoded = encode(&key, s);
10
(key, encoded.unwrap())
exercises/practice/simple-cipher/Cargo.toml
@@ -7,4 +7,4 @@ edition = "2024"
# The full list of available libraries is here:
# https://github.com/exercism/rust-test-runner/blob/main/local-registry/Cargo.toml
[dependencies]
-rand = "0.8"
+rand = "0.9"
0 commit comments