From 834007b7daac9458cd9e94aa306822d0e64712f7 Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Fri, 10 Feb 2023 13:10:40 -0800 Subject: [PATCH 1/6] Update strings-iterators.md --- src/exercises/day-2/strings-iterators.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/exercises/day-2/strings-iterators.md b/src/exercises/day-2/strings-iterators.md index fd92acdf9808..c2de7cc5fb36 100644 --- a/src/exercises/day-2/strings-iterators.md +++ b/src/exercises/day-2/strings-iterators.md @@ -10,10 +10,8 @@ pass. Try avoiding allocating a `Vec` for your intermediate results: ```rust -// TODO: remove this when you're done with your implementation. -#![allow(unused_variables, dead_code)] - -{{#include strings-iterators.rs:prefix_matches}} +pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { + println!("Use parameters {prefix} and {request_path}"); unimplemented!() } From 53f79bba942f53ded6cb3395d7b198c4095be545 Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Wed, 1 Mar 2023 20:52:43 -0800 Subject: [PATCH 2/6] Update strings-iterators.md --- src/exercises/day-2/strings-iterators.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/exercises/day-2/strings-iterators.md b/src/exercises/day-2/strings-iterators.md index c2de7cc5fb36..8c084dbfc058 100644 --- a/src/exercises/day-2/strings-iterators.md +++ b/src/exercises/day-2/strings-iterators.md @@ -10,6 +10,7 @@ pass. Try avoiding allocating a `Vec` for your intermediate results: ```rust +{{#include strings-iterators.rs:prefix_matches}} pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { println!("Use parameters {prefix} and {request_path}"); unimplemented!() From a97c6ab869f34cdede5d75a3253d05d7d5c4b2b8 Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Wed, 1 Mar 2023 21:05:59 -0800 Subject: [PATCH 3/6] Update strings-iterators.rs --- src/exercises/day-2/strings-iterators.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/exercises/day-2/strings-iterators.rs b/src/exercises/day-2/strings-iterators.rs index 088803f910ea..d9265761e866 100644 --- a/src/exercises/day-2/strings-iterators.rs +++ b/src/exercises/day-2/strings-iterators.rs @@ -12,6 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +//ANCHOR: prefix_matches_unimplemented +pub fn prefix_matches_unimplemented(prefix: &str, request_path: &str) -> bool { + println!("Use parameters {prefix} and {request_path}"); + unimplemented!() +} // ANCHOR: prefix_matches pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { // ANCHOR_END: prefix_matches From 64f0c0f7968dc5cd0dd21a4c02851e89c3f82bc5 Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Wed, 1 Mar 2023 21:07:05 -0800 Subject: [PATCH 4/6] Update strings-iterators.md --- src/exercises/day-2/strings-iterators.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/exercises/day-2/strings-iterators.md b/src/exercises/day-2/strings-iterators.md index 8c084dbfc058..45127f47480c 100644 --- a/src/exercises/day-2/strings-iterators.md +++ b/src/exercises/day-2/strings-iterators.md @@ -10,11 +10,7 @@ pass. Try avoiding allocating a `Vec` for your intermediate results: ```rust -{{#include strings-iterators.rs:prefix_matches}} -pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { - println!("Use parameters {prefix} and {request_path}"); - unimplemented!() -} +{{#include strings-iterators.rs:prefix_matches_unimplemented}} {{#include strings-iterators.rs:unit-tests}} ``` From 36734020ad4e8152f722cb2b53f29b165768644d Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Thu, 2 Mar 2023 21:38:28 -0800 Subject: [PATCH 5/6] Update strings-iterators.rs --- src/exercises/day-2/strings-iterators.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/exercises/day-2/strings-iterators.rs b/src/exercises/day-2/strings-iterators.rs index d9265761e866..088803f910ea 100644 --- a/src/exercises/day-2/strings-iterators.rs +++ b/src/exercises/day-2/strings-iterators.rs @@ -12,11 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//ANCHOR: prefix_matches_unimplemented -pub fn prefix_matches_unimplemented(prefix: &str, request_path: &str) -> bool { - println!("Use parameters {prefix} and {request_path}"); - unimplemented!() -} // ANCHOR: prefix_matches pub fn prefix_matches(prefix: &str, request_path: &str) -> bool { // ANCHOR_END: prefix_matches From 1e03df9e2a9fd9f2d2c98707529da8ab22c058d7 Mon Sep 17 00:00:00 2001 From: Charisee Chiw Date: Thu, 2 Mar 2023 21:41:42 -0800 Subject: [PATCH 6/6] Update strings-iterators.md --- src/exercises/day-2/strings-iterators.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/exercises/day-2/strings-iterators.md b/src/exercises/day-2/strings-iterators.md index 45127f47480c..2684d9e5db9a 100644 --- a/src/exercises/day-2/strings-iterators.md +++ b/src/exercises/day-2/strings-iterators.md @@ -10,7 +10,10 @@ pass. Try avoiding allocating a `Vec` for your intermediate results: ```rust -{{#include strings-iterators.rs:prefix_matches_unimplemented}} +{{#include strings-iterators.rs:prefix_matches}} + println!("Use parameters {prefix} and {request_path}"); + unimplemented!() +} {{#include strings-iterators.rs:unit-tests}} ```