George3d6 / Inquisitor

An easily extensible, minimal footprint monitoring tool. (Still in the testing phase)
BSD 2-Clause "Simplified" License
30 stars 4 forks source link

Comparator operator bug? #34

Closed Deedasmi closed 6 years ago

Deedasmi commented 6 years ago

While running clippy on the receptor, it pointed out this:

Both of these blocks are the same. Is the second one supposed to be an 'in' or like comparison?

George3d6 commented 6 years ago

Pressumably the merge has fixed this.

Deedasmi commented 6 years ago

Nah, but the line numbers changed on we. Those entire blocks are the same. Your "contains" block does an equality check.

Deedasmi commented 6 years ago

Lot easier to see in the latest commit:

https://github.com/George3d6/Inquisitor/blob/master/receptor/receptor_plugins/comparator/src/lib.rs#L136

Lines 136-138 and 140-142 are identical despite being under different conditions. Was that intentional or is it a bug?

George3d6 commented 6 years ago

Ups, that was indeed a bug, contains was meant to translate to .contains not ==, for some reason I had thought your pull request fixed that (my bad, I didn't look at it properly). Fixed it now