Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

series: fix outdated instructions #1919

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion exercises/practice/series/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -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!)