From dcc724888f5bbafcda35b394a758441cb1d5107c Mon Sep 17 00:00:00 2001 From: sijun-yang Date: Sat, 8 Aug 2026 20:10:47 +0900 Subject: [PATCH 1/3] Fix stale exercise references --- exercises/18_iterators/iterators5.rs | 16 ++++++++-------- exercises/23_conversions/conversions3.rs | 9 ++++----- rustlings-macros/info.toml | 3 --- solutions/18_iterators/iterators5.rs | 18 +++++++++--------- solutions/23_conversions/conversions3.rs | 9 ++++----- 5 files changed, 25 insertions(+), 30 deletions(-) diff --git a/exercises/18_iterators/iterators5.rs b/exercises/18_iterators/iterators5.rs index 7e434cc5f9..08f292d7e7 100644 --- a/exercises/18_iterators/iterators5.rs +++ b/exercises/18_iterators/iterators5.rs @@ -27,7 +27,7 @@ fn count_for(map: &HashMap, value: Progress) -> usize { // of a `for` loop. fn count_iterator(map: &HashMap, value: Progress) -> usize { // `map` is a hash map with `String` keys and `Progress` values. - // map = { "variables1": Complete, "from_str": None, … } + // map = { "variables1": Complete, "conversions3": None, … } } fn count_collection_for(collection: &[HashMap], value: Progress) -> usize { @@ -46,7 +46,7 @@ fn count_collection_for(collection: &[HashMap], value: Progres // iterator instead of a `for` loop. fn count_collection_iterator(collection: &[HashMap], value: Progress) -> usize { // `collection` is a slice of hash maps. - // collection = [{ "variables1": Complete, "from_str": None, … }, + // collection = [{ "variables1": Complete, "conversions3": None, … }, // { "variables2": Complete, … }, … ] } @@ -64,10 +64,10 @@ mod tests { let mut map = HashMap::new(); map.insert(String::from("variables1"), Complete); map.insert(String::from("functions1"), Complete); - map.insert(String::from("hashmap1"), Complete); - map.insert(String::from("arc1"), Some); - map.insert(String::from("as_ref_mut"), None); - map.insert(String::from("from_str"), None); + map.insert(String::from("hashmaps1"), Complete); + map.insert(String::from("smart_pointers3"), Some); + map.insert(String::from("conversions5"), None); + map.insert(String::from("conversions3"), None); map } @@ -81,8 +81,8 @@ mod tests { other.insert(String::from("variables2"), Complete); other.insert(String::from("functions2"), Complete); other.insert(String::from("if1"), Complete); - other.insert(String::from("from_into"), None); - other.insert(String::from("try_from_into"), None); + other.insert(String::from("conversions2"), None); + other.insert(String::from("conversions4"), None); vec![map, other] } diff --git a/exercises/23_conversions/conversions3.rs b/exercises/23_conversions/conversions3.rs index ec6d3fd129..7ab48c54ac 100644 --- a/exercises/23_conversions/conversions3.rs +++ b/exercises/23_conversions/conversions3.rs @@ -1,8 +1,7 @@ -// This is similar to the previous `from_into` exercise. But this time, we'll -// implement `FromStr` and return errors instead of falling back to a default -// value. Additionally, upon implementing `FromStr`, you can use the `parse` -// method on strings to generate an object of the implementor type. You can read -// more about it in the documentation: +// In this exercise, we'll implement `FromStr` and return errors instead of +// falling back to a default value. Upon implementing `FromStr`, you can use the +// `parse` method on strings to generate an object of the implementor type. +// You can read more about it in the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError; diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index 3a1cac3537..97c1ccaee9 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -1186,9 +1186,6 @@ hint = """ The implementation of `FromStr` should return an `Ok` with a `Person` object, or an `Err` with an error if the string is not valid. -This is almost like the previous `from_into` exercise, but returning errors -instead of falling back to a default value. - Another hint: You can use the `map_err` method of `Result` with a function or a closure to wrap the error from `parse::`. diff --git a/solutions/18_iterators/iterators5.rs b/solutions/18_iterators/iterators5.rs index 067a117b92..8aad8160a1 100644 --- a/solutions/18_iterators/iterators5.rs +++ b/solutions/18_iterators/iterators5.rs @@ -25,7 +25,7 @@ fn count_for(map: &HashMap, value: Progress) -> usize { fn count_iterator(map: &HashMap, value: Progress) -> usize { // `map` is a hash map with `String` keys and `Progress` values. - // map = { "variables1": Complete, "from_str": None, … } + // map = { "variables1": Complete, "conversions3": None, … } map.values().filter(|val| **val == value).count() } @@ -39,7 +39,7 @@ fn count_collection_for(collection: &[HashMap], value: Progres fn count_collection_iterator(collection: &[HashMap], value: Progress) -> usize { // `collection` is a slice of hash maps. - // collection = [{ "variables1": Complete, "from_str": None, … }, + // collection = [{ "variables1": Complete, "conversions3": None, … }, // { "variables2": Complete, … }, … ] collection .iter() @@ -55,7 +55,7 @@ fn count_collection_iterator_flat( value: Progress, ) -> usize { // `collection` is a slice of hash maps. - // collection = [{ "variables1": Complete, "from_str": None, … }, + // collection = [{ "variables1": Complete, "conversions3": None, … }, // { "variables2": Complete, … }, … ] collection .iter() @@ -77,10 +77,10 @@ mod tests { let mut map = HashMap::new(); map.insert(String::from("variables1"), Complete); map.insert(String::from("functions1"), Complete); - map.insert(String::from("hashmap1"), Complete); - map.insert(String::from("arc1"), Some); - map.insert(String::from("as_ref_mut"), None); - map.insert(String::from("from_str"), None); + map.insert(String::from("hashmaps1"), Complete); + map.insert(String::from("smart_pointers3"), Some); + map.insert(String::from("conversions5"), None); + map.insert(String::from("conversions3"), None); map } @@ -92,8 +92,8 @@ mod tests { other.insert(String::from("variables2"), Complete); other.insert(String::from("functions2"), Complete); other.insert(String::from("if1"), Complete); - other.insert(String::from("from_into"), None); - other.insert(String::from("try_from_into"), None); + other.insert(String::from("conversions2"), None); + other.insert(String::from("conversions4"), None); vec![map, other] } diff --git a/solutions/23_conversions/conversions3.rs b/solutions/23_conversions/conversions3.rs index 005b50125a..0da8f02900 100644 --- a/solutions/23_conversions/conversions3.rs +++ b/solutions/23_conversions/conversions3.rs @@ -1,8 +1,7 @@ -// This is similar to the previous `from_into` exercise. But this time, we'll -// implement `FromStr` and return errors instead of falling back to a default -// value. Additionally, upon implementing `FromStr`, you can use the `parse` -// method on strings to generate an object of the implementor type. You can read -// more about it in the documentation: +// In this exercise, we'll implement `FromStr` and return errors instead of +// falling back to a default value. Upon implementing `FromStr`, you can use the +// `parse` method on strings to generate an object of the implementor type. +// You can read more about it in the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError; From 11ce37fc937429363bd8cc410a6bd19d2e90b5b9 Mon Sep 17 00:00:00 2001 From: sijun-yang Date: Sun, 9 Aug 2026 15:35:18 +0900 Subject: [PATCH 2/3] Preserve conversions3 wording --- exercises/23_conversions/conversions3.rs | 6 +++--- solutions/23_conversions/conversions3.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/23_conversions/conversions3.rs b/exercises/23_conversions/conversions3.rs index 7ab48c54ac..71bae84501 100644 --- a/exercises/23_conversions/conversions3.rs +++ b/exercises/23_conversions/conversions3.rs @@ -1,7 +1,7 @@ // In this exercise, we'll implement `FromStr` and return errors instead of -// falling back to a default value. Upon implementing `FromStr`, you can use the -// `parse` method on strings to generate an object of the implementor type. -// You can read more about it in the documentation: +// falling back to a default value. Additionally, upon implementing `FromStr`, +// you can use the `parse` method on strings to generate an object of the +// implementor type. You can read more about it in the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError; diff --git a/solutions/23_conversions/conversions3.rs b/solutions/23_conversions/conversions3.rs index 0da8f02900..64e23a0255 100644 --- a/solutions/23_conversions/conversions3.rs +++ b/solutions/23_conversions/conversions3.rs @@ -1,7 +1,7 @@ // In this exercise, we'll implement `FromStr` and return errors instead of -// falling back to a default value. Upon implementing `FromStr`, you can use the -// `parse` method on strings to generate an object of the implementor type. -// You can read more about it in the documentation: +// falling back to a default value. Additionally, upon implementing `FromStr`, +// you can use the `parse` method on strings to generate an object of the +// implementor type. You can read more about it in the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError; From 7fc3088421afe742c68e664403a737e7a7cae1ab Mon Sep 17 00:00:00 2001 From: sijun-yang Date: Sun, 9 Aug 2026 22:00:42 +0900 Subject: [PATCH 3/3] Fix conversions3 explanation --- exercises/23_conversions/conversions3.rs | 10 ++++++---- solutions/23_conversions/conversions3.rs | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/exercises/23_conversions/conversions3.rs b/exercises/23_conversions/conversions3.rs index 71bae84501..7421782040 100644 --- a/exercises/23_conversions/conversions3.rs +++ b/exercises/23_conversions/conversions3.rs @@ -1,7 +1,9 @@ -// In this exercise, we'll implement `FromStr` and return errors instead of -// falling back to a default value. Additionally, upon implementing `FromStr`, -// you can use the `parse` method on strings to generate an object of the -// implementor type. You can read more about it in the documentation: +// In this exercise, we'll implement `FromStr` to convert data stored as a +// string into a structured type. Unlike the `From` trait, the conversion +// expressed by `FromStr` can fail, so it returns a `Result`. Additionally, +// upon implementing `FromStr`, you can use the `parse` method on strings to +// generate an object of the implementor type. You can read more about it in +// the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError; diff --git a/solutions/23_conversions/conversions3.rs b/solutions/23_conversions/conversions3.rs index 64e23a0255..95c23370d2 100644 --- a/solutions/23_conversions/conversions3.rs +++ b/solutions/23_conversions/conversions3.rs @@ -1,7 +1,9 @@ -// In this exercise, we'll implement `FromStr` and return errors instead of -// falling back to a default value. Additionally, upon implementing `FromStr`, -// you can use the `parse` method on strings to generate an object of the -// implementor type. You can read more about it in the documentation: +// In this exercise, we'll implement `FromStr` to convert data stored as a +// string into a structured type. Unlike the `From` trait, the conversion +// expressed by `FromStr` can fail, so it returns a `Result`. Additionally, +// upon implementing `FromStr`, you can use the `parse` method on strings to +// generate an object of the implementor type. You can read more about it in +// the documentation: // https://doc.rust-lang.org/std/str/trait.FromStr.html use std::num::ParseIntError;