cargo: fmt
This commit is contained in:
parent
724ee2d0d5
commit
0f465e150b
10
src/main.rs
10
src/main.rs
|
@ -8,10 +8,8 @@ fn memorised_words(word_counts: Vec<HashMap<String, i32>>, ranges: Vec<&str>) ->
|
|||
for word_count in word_counts {
|
||||
for &range in &ranges {
|
||||
match word_count.get(range) {
|
||||
Some(length) => {
|
||||
total_memorised += length
|
||||
},
|
||||
None => {},
|
||||
Some(length) => total_memorised += length,
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +19,8 @@ fn memorised_words(word_counts: Vec<HashMap<String, i32>>, ranges: Vec<&str>) ->
|
|||
|
||||
fn main() {
|
||||
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
|
||||
let mut input = String::new();
|
||||
|
|
Loading…
Reference in a new issue