diff --git a/src/macros.rs b/src/macros.rs index c44b44fffdd5..52ac28f10f56 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -198,22 +198,3 @@ macro_rules! joinable_inner { } } } - -macro_rules! left_outer_queriable { - ($parent:ty, $parent_table:ident, $child:ty, $child_table:ident) => { - impl $crate::Queriable<($parent_table::SqlType, $crate::types::Nullable<$child_table::SqlType>)> - for ($parent, Option<$child>) { - type Row = ( - <$parent as $crate::Queriable<$parent_table::SqlType>>::Row, - Option<<$child as $crate::Queriable<$child_table::SqlType>>::Row>, - ); - - fn build(row: Self::Row) -> Self { - ( - <$parent as $crate::Queriable<$parent_table::SqlType>>::build(row.0), - row.1.map(<$child as $crate::Queriable<$child_table::SqlType>>::build), - ) - } - } - } -} diff --git a/src/tests/schema.rs b/src/tests/schema.rs index 56169dbd03e2..1baf84db77c4 100644 --- a/src/tests/schema.rs +++ b/src/tests/schema.rs @@ -67,7 +67,6 @@ queriable! { } joinable!(posts -> users (user_id = id)); -left_outer_queriable!(User, users, Post, posts); #[derive(Debug, PartialEq, Eq)] pub struct NewUser { diff --git a/src/types/impls/option.rs b/src/types/impls/option.rs index 83d94c7ffeac..27b4a31d05b6 100644 --- a/src/types/impls/option.rs +++ b/src/types/impls/option.rs @@ -20,12 +20,13 @@ impl FromSql> for Option where impl Queriable> for Option where T: Queriable, - Option: FromSqlRow>, + Option: FromSqlRow>, ST: NativeSqlType, { - type Row = Self; - fn build(row: Self) -> Self { - row + type Row = Option; + + fn build(row: Self::Row) -> Self { + row.map(T::build) } }