D7178: [RFC] rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Thu Oct 31 09:40:00 EDT 2019
Alphare added inline comments.
> martinvonz wrote in matchers.rs:20-21
> Is `Empty` needed as an optimization? Or could we just use an empty set?
I feel like Rust enums are really cheap to make and maintain, and since the original code hints at possible optimizations for this case I feel like it's worth it for readability. We can always back out of this if it turns out to be a pain
> martinvonz wrote in matchers.rs:35
> Drop the `_` prefix here too. Does the compiler really warn about unused arguments even in trait definitions?
It does when it's implemented. `matches()` sounds good
CHANGES SINCE LAST ACTION
To: Alphare, #hg-reviewers
Cc: martinvonz, spectral, durin42, kevincox, mercurial-devel
More information about the Mercurial-devel