Why not impl Eq for globset::GlobMatcher
?
#2581
-
Not a push to do this, but to understand if I'm missing something. I noticed that
but not So would it be safe to * I'd expect this may be doable under the constraint of globs, but unsure about full regex. But I think tougher than needed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't think there's any particular reason. And to be honest, I'm not a huge fan of implementing With all that said, |
Beta Was this translation helpful? Give feedback.
I don't think there's any particular reason. And to be honest, I'm not a huge fan of implementing
PartialEq
orEq
onGlob
(orGlobSet
) itself. There's an ambiguity there about whatPartialEq
/Eq
actually means. For theregex
crate, for example, I chose not to implementPartialEq
/Eq
forRegex
for what is essentially that reason: does equality mean that the same pattern was used to build two distinctRegex
values, or does equality mean that the two distinctRegex
values match precisely the same set of strings? The latter has a precisely defined meaning for regular languages, but is unfortunately quite expensive to compute. I reckon the same is true of globs. For example, should the two globsa
…