Skip to content

Conversation

@ch3pjw
Copy link

@ch3pjw ch3pjw commented Oct 21, 2025

It appears that the lifetime of Q: StatementLike + 'a in Queryable::exec_iter is at odds with that in, for example Queryable::exec where Q: StatementLike + 'b. In the first case the 'a is the lifetime of the Queryable thing (the connection, transaction or so forth), whilst in the second case the 'b is the lifetime of the StatementLike thing itself.

It feels to me like the correct lifetime for the StatementLike should 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 'a and 'b the same in my code.

An additional question would be that exec_iter uses 's as the lifetime for the StatementLike, which I find a lot more readable than the 'b used elsewhere. Could/should it be updated to be 's everywhere for consistency?

Note the PR also suppresses a Clippy waning, just so that I was starting from a lean slate before my changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant