StatementLike lifetime consistency in Queryable
#378
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.
It appears that the lifetime of
Q: StatementLike + 'ainQueryable::exec_iteris at odds with that in, for exampleQueryable::execwhereQ: StatementLike + 'b. In the first case the'ais the lifetime of theQueryablething (the connection, transaction or so forth), whilst in the second case the'bis the lifetime of theStatementLikething itself.It feels to me like the correct lifetime for the
StatementLikeshould be it's own lifetime. This PR proposes that. This does have a material effect on some code I'm writing elsewhere - with the overly constrained lifetimes before this PR, I effectively have to make'aand'bthe same in my code.An additional question would be that
exec_iteruses'sas the lifetime for theStatementLike, which I find a lot more readable than the'bused elsewhere. Could/should it be updated to be'severywhere for consistency?Note the PR also suppresses a Clippy waning, just so that I was starting from a lean slate before my changes.