Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/practice/simple-cipher/.meta/example.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use rand::Rng;

pub fn encode_random(s: &str) -> (String, String) {
let mut r = rand::thread_rng();
let mut r = rand::rng();
let mut key = String::new();
for _ in 0..100 {
key.push(char::from(b'a' + r.gen_range(0..26)));
key.push(char::from(b'a' + r.random_range(0..26)));
}
let encoded = encode(&key, s);
(key, encoded.unwrap())
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/simple-cipher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"