-
Notifications
You must be signed in to change notification settings - Fork 54
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
Scan::execute takes an Arc<dyn EngineData> now #553
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #553 +/- ##
=======================================
Coverage 80.61% 80.61%
=======================================
Files 67 67
Lines 14278 14278
Branches 14278 14278
=======================================
Hits 11510 11510
Misses 2188 2188
Partials 580 580 ☔ View full report in Codecov by Sentry. |
read_with_scan_data(table.location(), engine.as_ref(), &scan, &expected)?; | ||
read_with_execute(engine, &scan, &expected)?; |
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.
Note: Order swapped so we don't have to clone the engine
that read_with_execute
consumes
Attn @zachschuermann: something went wrong with the semver check, it didn't flag a change to a pub fn signature in a pub struct in a pub mod as a breaking 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.
nice!
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.
This seems very reasonable to me.
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.
lgtm. thanks, this is better!
What changes are proposed in this pull request?
A previous change made
Scan::execute
return a lazy iterator instead of a collection, but in doing so it captured a&dyn Engine
which limits the lifetime of the iterator. This is silly, given that the caller has access to anArc<dyn Engine>
precisely to avoid lifetime problems.Update the method to take an Arc and fix the compiler carnage that results.
Fixes #551
This PR affects the following public APIs
Scan::execute
is public, as are some of the impacted methods that rely on it.How was this change tested?
Compilation suffices (yay for rust borrow checker!)