From 1a5352d08b62ce8e93faaccc40c9e8da1fc1c729 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Tue, 7 May 2024 09:06:48 +0200 Subject: [PATCH] series: fix outdated instructions (#1919) The controversial test case was previously removed without updating the exercise instructions. This change brings the instructions in line with the tests. - [PR removing the test][1] - [forum discussion about removing the test][2] - [report of outdated documentation][3] [1]: https://github.com/exercism/rust/pull/1822 [2]: https://forum.exercism.org/t/feedback-wanted-removing-controversial-test-from-series-exercise/8659 [3]: https://forum.exercism.org/t/add-test-for-zero-length-case-on-exercise-series/11070 --- exercises/practice/series/.docs/instructions.append.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exercises/practice/series/.docs/instructions.append.md b/exercises/practice/series/.docs/instructions.append.md index d55ab1e1b..536a61a3d 100644 --- a/exercises/practice/series/.docs/instructions.append.md +++ b/exercises/practice/series/.docs/instructions.append.md @@ -1,4 +1,10 @@ # Instructions append Different languages on Exercism have different expectations about what the result should be if the length of the substrings is zero. -For Rust, we expect you to output a number of empty strings, which will be one greater than the length of the input string. +On the Rust track, we don't have a test for that case, so you are free to do what you feel is most appropriate. + +Consider the advantages and disadvantages of the following possibilities: +- Crash the program with `panic!`. +- Return a `Result::Err`. (not possible here, because the function signature is given) +- Return an empty vector. +- Return a vector containing as many empty strings as the lenght of the string "digits" **plus one**. (this has some nice mathematical properties!)