summaryrefslogtreecommitdiff
path: root/exercises/options
AgeCommit message (Collapse)Author
2023-10-16Update Exercises Directory Names to Reflect OrderAdam Brewer
2023-05-29docs: cleanup the explanation paragraphs at the start of each exercise.Robert Fry
2023-05-17Merge pull request #1487 from lionel-rowe/patch-1liv
feat(options2): better test for layered_option
2023-05-09fix(options3): panic when not matching to avoid false positivesNoah May
Closes #1503
2023-04-21feat(options2): better tests for layered_optionlionel-rowe
The existing test can be solved with the following: ```rs while let Some(integer) = optional_integers.pop() { assert_eq!(integer.unwrap(), range); ``` Similarly with `expect(...)`, `unwrap_or(0)`, `unwrap_or_default()`, etc. However, none of these solutions use the learning point of stacking `Option<T>`s. The updated test can _only_ be solved by stacking `Option<T>`s: ```rs while let Some(Some(integer)) = optional_integers.pop() { assert_eq!(integer, cursor); ``` With the updated test, using `unwrap` or `expect` will panic when it hits the `None` value, and using `unwrap_or` or `unwrap_or_default` will cause the final `assert_eq!(cursor, 0)` to panic.
2023-03-30feat(docs): add markdown linter for exercises README.md filesAli Afsharzadeh
2023-02-12Merge pull request #1228 from grzegorz-zur/patch-1liv
Removed unnecessary use statement
2022-11-24chore: added more descriptive TODOsTK Buristrakul
2022-10-11docs(options1): fix and clarify 24 hour time instructionbhbuehler
2022-10-11Removed unnecessary use statementGrzegorz Żur
2022-08-17chore: make options2 not compile deliberatelymagnusrodseth
2022-08-17test: Convert main function to working testsmagnusrodseth
2022-08-17Update options1.rsvostok92
Fix assertions
2022-08-15Update options1.rsNico Vromans
Added extra test for before 10PM and updated the test for at 10PM (when it's 10PM there should already not be any ice cream left, as per the description). Also fixed the `raw_value` test, as it is later than 10PM, so there should be no more ice cream left.
2022-08-11fix(options1): remove unused codeMarkus Boehme
Since rewriting the exercise in commit 06e4fd376586 the print_number function goes unused. Remove it.
2022-07-26feat(options1): update expected resultTristan Nicholls
Expected result is updated to better showcase the difference between - a valid result with no ice-creams `Some(0)`, and - an invalid result `None`.
2022-07-14feat(options): add hint commentsmokou
2022-07-14feat(options1): rewrite to remove array stuffmokou
2022-07-14fix: rename option to optionsmokou