Conversions from Condition and ConditionExpression into SimpleExpr#886
Merged
tyt2y3 merged 1 commit intoSeaQL:masterfrom May 20, 2025
Merged
Conversions from Condition and ConditionExpression into SimpleExpr#886tyt2y3 merged 1 commit intoSeaQL:masterfrom
Condition and ConditionExpression into SimpleExpr#886tyt2y3 merged 1 commit intoSeaQL:masterfrom
Conversation
Condition and ConditionExpression into SimpleExprCondition and ConditionExpression into SimpleExpr
tyt2y3
approved these changes
May 20, 2025
Member
|
merged. can make a patch release this week, or you can still use git dependency |
🎉 Released In 0.32.6 🎉Thank you everyone for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Yet another type conversion problem that drove me insane.
Motivating examples:
I needed
Func::coalesce([my_condition.into(), false.into()]). ButcoalesceacceptsSimpleExprs and there's no public way to convertmy_conditionintoSimpleExpr! Not a single public workaround. Which is crazy, because it's obviously already implemented (privately).I needed
.expr_as(any![..], "my_alias"). Butexpr_asacceptsInto<SimpleExpr>andany!is aConditionthat didn't implement that. This one's less urgent, because there's an.or()chain workaround.The first one is useful/urgent enough that I'm going to use
[patch.crates-io]and immediately depend on this fork in my project.If you look at the diff, the new conversion method may seem less efficient than the old one, because the conversion now consumes the
Conditionand there's a new.clone()call because of that. However, nothing has actually changed. The old non-consuming function was doing the sameclone()ing inside of its body, and I removed that call.PR Info
New Features
impl From<Condition> for SimpleExprimpl From<ConditionExpression> for SimpleExprBug Fixes
Breaking Changes
Changes