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

Rename MatcherResult::into_bool to MatcheResult::is_match. #259

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

hovinen
Copy link
Collaborator

@hovinen hovinen commented Jul 14, 2023

This also pulls the proper implementation from the impl From<MatcherResult> for bool block into is_match and has the former implementation defer to this method.

The naming is_match is closer to other Rust idioms such as Result::is_ok, Result::is_err, etc. It makes more sense to define the method explicitly according to its intended behaviour and then add a From implementation as a convenience.

hovinen added 2 commits July 14, 2023 15:16
These new names are more concise and better correspond to the naming of `MatcherResult`. Namely, they are nouns specifying the result rather than verbs.
This also pulls the proper implementation from the `impl From<MatcherResult> for bool` block into `is_match` and has the former implementation defer to this method.

The naming `is_match` is closer to other Rust idioms such as `Result::is_ok`, `Result::is_err`, etc. It makes more sense to define the method explicitly according to its intended behaviour and then add a `From` implementation as a convenience.
@hovinen hovinen force-pushed the rename-matcher-result-into-bool branch from cf668ac to e58547a Compare July 14, 2023 13:24
@copybara-service copybara-service bot merged commit 59c5082 into main Jul 14, 2023
@gribozavr gribozavr deleted the rename-matcher-result-into-bool branch February 17, 2025 18:29
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.

1 participant