From 0f465e150b2c04167c904cbd83a7cdb6b9a2fb07 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 23 Oct 2024 11:48:43 +0100 Subject: [PATCH] cargo: fmt --- src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 02bfbeb..9c771f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,10 +8,8 @@ fn memorised_words(word_counts: Vec>, 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>, ranges: Vec<&str>) -> fn main() { let file_data = fs::read_to_string("data.json").expect("Unable to read file"); - let word_counts: Vec> = serde_json::from_str(&file_data).expect("Could not parse JSON data"); - + let word_counts: Vec> = + serde_json::from_str(&file_data).expect("Could not parse JSON data"); // Read input from standard input let mut input = String::new();