Skip to content

wordy: Added template to the stub file #595

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

Merged
merged 2 commits into from
Aug 8, 2018

Conversation

ZapAnton
Copy link
Contributor

@ZapAnton ZapAnton commented Jul 31, 2018

Contributes to the #551

The returned type of the WordProblem::answer function is Result<i32, String>, but perhaps Option<i32> is more suited here?

@petertseng
Copy link
Member

perhaps Option<i32> is more suited here?

yes, I think so. At the time I wrote #444 (comment) I was thinking strings for the E in Result<T, E> are not programmatically inspectable so would be better replaced by a type that is, or None.

@ZapAnton
Copy link
Contributor Author

ZapAnton commented Aug 3, 2018

Done


pub fn answer(&self) -> Option<i32> {
unimplemented!(
"Return the result of the transmitted command, or an error, if the command is invalid."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should talk about None instead of error, now, right?

I'll prefer that change be amended into the Result -> Option commit so all the necessary changes for Result->Option are in one commit. It's small enough that amending won't cause a review burden.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Member

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this, @ZapAnton! Assuming the wording change is made and there are no other maintainer objections, I'll merge this not later than Wednesday.


pub fn answer(&self) -> Option<i32> {
unimplemented!(
"Return the result of the transmitted command, or an error, if the command is invalid."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

@coriolinus coriolinus merged commit 3138f98 into exercism:master Aug 8, 2018
@ZapAnton ZapAnton deleted the wordy_template branch August 8, 2018 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants