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: Literal comparison with BinaryOperator #1397
Conversation
…rator when lteq, gteq comp
It seems better to create a branch from the latest |
Thank you! |
core/src/executor/evaluate/expr.rs
Outdated
BinaryOperator::LtEq => { | ||
if l.evaluate_cmp(&r).is_none() { | ||
return Ok(Evaluated::from(Value::Bool(false))); | ||
} | ||
cmp!(l.evaluate_cmp(&r) != Some(Ordering::Greater)) | ||
} |
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.
matches!
would be useful. same approach can be applied for BinaryOperator::GtEq
BinaryOperator::LtEq => cmp!(matches!(
l.evaluate_cmp(&r),
Some(Ordering::Less) | Some(Ordering::Equal)
)),
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.
Wow! matches! macro thank you~
Pull Request Test Coverage Report for Build 6145793371
💛 - Coveralls |
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.
Looks nice! Thanks a lot 👍
resolves #1306