In #269 we decided that exercises should have stubs. In #371 we further decided that the provided stubs should compile.
For all exercises that have function(s) expecting a Result<T, E>, this poses a question: What type should go in the stub for E?
I'm starting to shy away from using str as an error type since it is difficult to programmatically inspect, but now need to think about which of the other options I prefer. Perhaps my reason is bogus and using str is okay (let me know!). A contributor once also said this as a tip, but did not provide reasoning, so I cannot evaluate the tip. #259 (comment)
Need to think about the goals: Are we trying to teach something via these stubs? Or is it precisely the minimum code needed to get it to compile?
In #269 we decided that exercises should have stubs. In #371 we further decided that the provided stubs should compile.
For all exercises that have function(s) expecting a
Result<T, E>, this poses a question: What type should go in the stub forE?(), but have a comment explaining that the type can be changed. Currently used in https://github.com/exercism/rust/blob/master/exercises/react/src/lib.rs (rather too late, I would think).(), with no additional explanations.PUT_YOUR_ERROR_TYPE_HERE. Not yet used in this track, because it would cause the stub not to compile. We are able to mark stubs as allowed to not compile (https://github.com/exercism/rust/blob/master/exercises/decimal/.meta/ALLOWED_TO_NOT_COMPILE) but it should be used sparingly.BowlingErrorbut leaveBowlingErroras simplypub struct BowlingError {}.&'static strwith the idea that it's to be used as an error message. Currently used in https://github.com/exercism/rust/blob/master/exercises/variable-length-quantity/src/lib.rsI'm starting to shy away from using
stras an error type since it is difficult to programmatically inspect, but now need to think about which of the other options I prefer. Perhaps my reason is bogus and usingstris okay (let me know!). A contributor once also said this as a tip, but did not provide reasoning, so I cannot evaluate the tip. #259 (comment)Need to think about the goals: Are we trying to teach something via these stubs? Or is it precisely the minimum code needed to get it to compile?