cargo: fmt

This commit is contained in:
Muhammad Nauman Raza 2024-10-23 11:48:43 +01:00
parent 724ee2d0d5
commit 0f465e150b
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -8,10 +8,8 @@ fn memorised_words(word_counts: Vec<HashMap<String, i32>>, ranges: Vec<&str>) ->
for word_count in word_counts { for word_count in word_counts {
for &range in &ranges { for &range in &ranges {
match word_count.get(range) { match word_count.get(range) {
Some(length) => { Some(length) => total_memorised += length,
total_memorised += length None => {}
},
None => {},
} }
} }
} }
@ -21,8 +19,8 @@ fn memorised_words(word_counts: Vec<HashMap<String, i32>>, ranges: Vec<&str>) ->
fn main() { fn main() {
let file_data = fs::read_to_string("data.json").expect("Unable to read file"); let file_data = fs::read_to_string("data.json").expect("Unable to read file");
let word_counts: Vec<HashMap<String, i32>> = serde_json::from_str(&file_data).expect("Could not parse JSON data"); let word_counts: Vec<HashMap<String, i32>> =
serde_json::from_str(&file_data).expect("Could not parse JSON data");
// Read input from standard input // Read input from standard input
let mut input = String::new(); let mut input = String::new();