-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle Expr::Binary
properly in walk_expr
#89
fix: handle Expr::Binary
properly in walk_expr
#89
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
=======================================
Coverage 98.99% 98.99%
=======================================
Files 14 14
Lines 6272 6296 +24
=======================================
+ Hits 6209 6233 +24
Misses 63 63 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Thanks for this fixing.
This PR is good enough for merging. It would be better if you are willing to add a unit test to reflect this change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you please fix the clippy warning?
I added some tests, but I'm new to Rust so please check if I organized the code correctly. 😅 |
I checked it, but I have no idea how to fix it. The message says there are possible "refactorings" in the file |
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Thank you @scintillavoy ❤️ |
When handling
Expr::Binary
inwalk_expr
, the return values from lhs and rhs are ORed (||
) but it should be&&
.For example, let the expression be
foo{l1="v1"} + bar{l2="v2"}
.walk_expr
will recurse into lhs (foo
) first and if the return value isOk(true)
, it should recurse into rhs (bar
) but it would not.Additionally, there was a small inconsistency in the example (newlines between the output), so I fixed it.