From 603a6c27acf6d62412df6f045bf7a5ddd8c4d952 Mon Sep 17 00:00:00 2001 From: perro Date: Fri, 10 Mar 2023 13:19:05 -0800 Subject: [PATCH] Terminado :D --- exercises/error_handling/errors5.rs | 1 - exercises/hashmaps/hashmaps1.rs | 3 +-- exercises/hashmaps/hashmaps2.rs | 3 --- exercises/hashmaps/hashmaps3.rs | 5 ----- exercises/iterators/iterators1.rs | 8 ++++---- exercises/modules/modules2.rs | 1 - exercises/modules/modules3.rs | 1 - 7 files changed, 5 insertions(+), 17 deletions(-) diff --git a/exercises/error_handling/errors5.rs b/exercises/error_handling/errors5.rs index f93f705..c8a2885 100644 --- a/exercises/error_handling/errors5.rs +++ b/exercises/error_handling/errors5.rs @@ -20,7 +20,6 @@ use std::error; use std::fmt; use std::num::ParseIntError; -// TODO: update the return type of `main()` to make this compile. fn main() -> Result<(), Box> { let pretend_user_input = "42"; let x: i64 = pretend_user_input.parse()?; diff --git a/exercises/hashmaps/hashmaps1.rs b/exercises/hashmaps/hashmaps1.rs index d77c291..fc26d2c 100644 --- a/exercises/hashmaps/hashmaps1.rs +++ b/exercises/hashmaps/hashmaps1.rs @@ -13,12 +13,11 @@ use std::collections::HashMap; fn fruit_basket() -> HashMap { - let mut basket = HashMap::new(); // TODO: declare your hash map here. + let mut basket = HashMap::new(); // Two bananas are already given for you :) basket.insert(String::from("banana"), 2); - // TODO: Put more fruits in your basket here. basket.insert(String::from("avocado"), 2); basket.insert(String::from("tomato"), 1); basket.insert(String::from("potato"), 1); diff --git a/exercises/hashmaps/hashmaps2.rs b/exercises/hashmaps/hashmaps2.rs index 1c011cd..042ddd0 100644 --- a/exercises/hashmaps/hashmaps2.rs +++ b/exercises/hashmaps/hashmaps2.rs @@ -32,9 +32,6 @@ fn fruit_basket(basket: &mut HashMap) { ]; for fruit in fruit_kinds { - // TODO: Put new fruits if not already present. Note that you - // are not allowed to put any type of fruit that's already - // present! basket.entry(fruit).or_insert(3); } } diff --git a/exercises/hashmaps/hashmaps3.rs b/exercises/hashmaps/hashmaps3.rs index c343fb2..757f45b 100644 --- a/exercises/hashmaps/hashmaps3.rs +++ b/exercises/hashmaps/hashmaps3.rs @@ -33,11 +33,6 @@ fn build_scores_table(results: String) -> HashMap { let team_1_score: u8 = v[2].parse().unwrap(); let team_2_name = v[1].to_string(); let team_2_score: u8 = v[3].parse().unwrap(); - // TODO: Populate the scores table with details extracted from the - // current line. Keep in mind that goals scored by team_1 - // will be the number of goals conceded from team_2, and similarly - // goals scored by team_2 will be the number of goals conceded by - // team_1. let team_1 = scores.entry(team_1_name.clone()).or_insert(Team { name: team_1_name, goals_scored: 0, diff --git a/exercises/iterators/iterators1.rs b/exercises/iterators/iterators1.rs index 544dc67..900623e 100644 --- a/exercises/iterators/iterators1.rs +++ b/exercises/iterators/iterators1.rs @@ -11,12 +11,12 @@ fn main () { let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"]; - let mut my_iterable_fav_fruits = my_fav_fruits.iter(); // TODO: Step 1 + let mut my_iterable_fav_fruits = my_fav_fruits.iter(); assert_eq!(my_iterable_fav_fruits.next(), Some(&"banana")); - assert_eq!(my_iterable_fav_fruits.next(), Some(&"custard apple")); // TODO: Step 2 + assert_eq!(my_iterable_fav_fruits.next(), Some(&"custard apple")); assert_eq!(my_iterable_fav_fruits.next(), Some(&"avocado")); - assert_eq!(my_iterable_fav_fruits.next(), Some(&"peach")); // TODO: Step 3 + assert_eq!(my_iterable_fav_fruits.next(), Some(&"peach")); assert_eq!(my_iterable_fav_fruits.next(), Some(&"raspberry")); - assert_eq!(my_iterable_fav_fruits.next(), None); // TODO: Step 4 + assert_eq!(my_iterable_fav_fruits.next(), None); } diff --git a/exercises/modules/modules2.rs b/exercises/modules/modules2.rs index 65ea5a8..3384894 100644 --- a/exercises/modules/modules2.rs +++ b/exercises/modules/modules2.rs @@ -4,7 +4,6 @@ // Execute `rustlings hint modules2` or use the `hint` watch subcommand for a hint. mod delicious_snacks { - // TODO: Fix these use statements pub use self::fruits::PEAR as fruit; pub use self::veggies::CUCUMBER as veggie; diff --git a/exercises/modules/modules3.rs b/exercises/modules/modules3.rs index 0d0264c..f669ecf 100644 --- a/exercises/modules/modules3.rs +++ b/exercises/modules/modules3.rs @@ -5,7 +5,6 @@ // from the std::time module. Bonus style points if you can do it with one line! // Execute `rustlings hint modules3` or use the `hint` watch subcommand for a hint. -// TODO: Complete this use statement use std::time::{SystemTime, UNIX_EPOCH}; fn main() {