Skip to content

Commit 2123d9d

Browse files
argv-minus-onemehcode
authored andcommitted
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.
1 parent fc6eb63 commit 2123d9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlx-core/src/connection.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ pub trait Connection: Send {
5050
/// })).await
5151
/// # }
5252
/// ```
53-
fn transaction<F, R, E>(&mut self, callback: F) -> BoxFuture<'_, Result<R, E>>
53+
fn transaction<'a, F, R, E>(&'a mut self, callback: F) -> BoxFuture<'a, Result<R, E>>
5454
where
5555
for<'c> F: FnOnce(&'c mut Transaction<'_, Self::Database>) -> BoxFuture<'c, Result<R, E>>
56-
+ 'static
56+
+ 'a
5757
+ Send
5858
+ Sync,
5959
Self: Sized,

0 commit comments

Comments
 (0)