From 4ad4a42eddf0cf4db86e342f1a11710915f9a619 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 30 Sep 2020 18:23:54 +0200 Subject: [PATCH] Make Send a supertrait of TryMapRow, MapRow Map<'q, DB, F, A> where F: !Send was useless and these traits are only used as part of Map. This might improve error messages. --- sqlx-core/src/query.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlx-core/src/query.rs b/sqlx-core/src/query.rs index b5b373e4..a6d02184 100644 --- a/sqlx-core/src/query.rs +++ b/sqlx-core/src/query.rs @@ -356,13 +356,13 @@ where // // See https://github.com/rust-lang/rust/issues/62529 -pub trait TryMapRow { +pub trait TryMapRow: Send { type Output: Unpin; fn try_map_row(&mut self, row: DB::Row) -> Result; } -pub trait MapRow { +pub trait MapRow: Send { type Output: Unpin; fn map_row(&mut self, row: DB::Row) -> Self::Output; @@ -449,7 +449,7 @@ macro_rules! impl_map_row { ($DB:ident, $R:ident) => { impl crate::query::MapRow<$DB> for F where - F: FnMut($R) -> O, + F: Send + FnMut($R) -> O, { type Output = O; @@ -460,7 +460,7 @@ macro_rules! impl_map_row { impl crate::query::TryMapRow<$DB> for F where - F: FnMut($R) -> Result, + F: Send + FnMut($R) -> Result, { type Output = O;