validation icon indicating copy to clipboard operation
validation copied to clipboard

`In` and `NotIn` inconsistent

Open andremedeiros opened this issue 1 year ago • 3 comments

While using the In and NotIn rules, I've noticed that their implementations are inconsistent. The former uses DeepEqual to verify equality, whereas the latter uses the equality operator. In cases where pointers are being passed with the same underlying data, the former would work, but the latter falls short.

Can we have a discussion on whether NotIn should incorporate DeepEqual?

andremedeiros avatar Sep 26 '23 22:09 andremedeiros

That's quite strange. These functions haven't been changed since they were first implemented/updated in the original repository, so I cannot answer why these inconsistencies exist, but we can certainly discuss whether they should be updated here.

swithek avatar Sep 28 '23 09:09 swithek

That's great! I'd probably prefer going for the DeepEqual approach, which is more in line with the spirit of what these functions are trying to do. Would you accept a PR?

andremedeiros avatar Sep 28 '23 14:09 andremedeiros

Yes, that sounds good to me. Feel free to open a PR whenever you want!

swithek avatar Sep 28 '23 18:09 swithek