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 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();
|
||||||
|
|
Loading…
Reference in a new issue