mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
Make the bounds on Connection::transaction less strict.
The provided callback doesn't need to be `'static`. It should be enough that it doesn't borrow anything from the `Connection` itself, even if it does borrow data from elsewhere.
This commit is contained in:
parent
fc6eb6363b
commit
2123d9de2e
@ -50,10 +50,10 @@ pub trait Connection: Send {
|
||||
/// })).await
|
||||
/// # }
|
||||
/// ```
|
||||
fn transaction<F, R, E>(&mut self, callback: F) -> BoxFuture<'_, Result<R, E>>
|
||||
fn transaction<'a, F, R, E>(&'a mut self, callback: F) -> BoxFuture<'a, Result<R, E>>
|
||||
where
|
||||
for<'c> F: FnOnce(&'c mut Transaction<'_, Self::Database>) -> BoxFuture<'c, Result<R, E>>
|
||||
+ 'static
|
||||
+ 'a
|
||||
+ Send
|
||||
+ Sync,
|
||||
Self: Sized,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user