Skip to content

Conversation

@hovinen
Copy link
Contributor

@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.

2 participants