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

Consider exposing word from UnknownWordError #4

Open
Kixunil opened this issue Oct 10, 2021 · 0 comments
Open

Consider exposing word from UnknownWordError #4

Kixunil opened this issue Oct 10, 2021 · 0 comments

Comments

@Kixunil
Copy link
Contributor

Kixunil commented Oct 10, 2021

Inspecting specific word that is unknown may be useful to some callers but adding a method to retrieve it basically commits to always storing it within error type. I think it's very reasonable to expect that it will always be there but opened an issue just in case.
The suggested method is:

/// The word that is not known
fn word(&self) -> &str {
    &self.word
}

An alternative would be to continue scanning the words even after error and return a slice of all unknown words.

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

No branches or pull requests

1 participant