Skip to content

Commit 6733465

Browse files
committed
remove 'static requirements on LoadQuery and LoadQueryGatWorkaround trait bounds, allowing non-'static types to implement them
1 parent d764f7d commit 6733465

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/run_query_dsl/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub mod methods {
9696
U: Send,
9797
T: AsQuery + Send,
9898
T::SqlType: CompatibleType<U, DB, SqlType = ST>,
99-
U: FromSqlRow<ST, DB> + Send + 'static,
99+
U: FromSqlRow<ST, DB> + Send,
100100
DB: QueryMetadata<T::SqlType>,
101101
{
102102
type LoadFuture = futures::future::MapOk<
@@ -115,13 +115,12 @@ pub mod methods {
115115
where
116116
Conn: AsyncConnection<Backend = DB>,
117117
U: Send,
118-
DB: Backend + 'static,
118+
DB: Backend,
119119
T: AsQuery + Send + 'query,
120120
T::Query: QueryFragment<DB> + QueryId + Send + 'query,
121121
T::SqlType: CompatibleType<U, DB, SqlType = ST>,
122-
U: FromSqlRow<ST, DB> + Send + 'static,
122+
U: FromSqlRow<ST, DB> + Send,
123123
DB: QueryMetadata<T::SqlType>,
124-
ST: 'static,
125124
{
126125
fn internal_load<'conn>(
127126
self,
@@ -142,9 +141,8 @@ pub mod methods {
142141
where
143142
S: Stream<Item = QueryResult<R>> + Send + 's,
144143
R: diesel::row::Row<'a, DB> + 's,
145-
DB: Backend + 'static,
146-
U: FromSqlRow<ST, DB> + 'static,
147-
ST: 'static,
144+
DB: Backend,
145+
U: FromSqlRow<ST, DB>,
148146
{
149147
stream.map(map_row_helper::<_, DB, U, ST>)
150148
}

0 commit comments

Comments
 (0)