From 73d35e73a6bc0eb4c02e5711a6febf1cdeec7d52 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 12 Apr 2021 13:23:06 +0200 Subject: [PATCH] Remove `Self: Type` bounds in Encode / Decode implementations --- sqlx-core/src/postgres/types/array.rs | 3 --- sqlx-core/src/types/json.rs | 3 --- 2 files changed, 6 deletions(-) diff --git a/sqlx-core/src/postgres/types/array.rs b/sqlx-core/src/postgres/types/array.rs index c81c23895d..cf2baea40a 100644 --- a/sqlx-core/src/postgres/types/array.rs +++ b/sqlx-core/src/postgres/types/array.rs @@ -37,7 +37,6 @@ impl<'q, T> Encode<'q, Postgres> for Vec where for<'a> &'a [T]: Encode<'q, Postgres>, T: Encode<'q, Postgres>, - Self: Type, { #[inline] fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull { @@ -48,7 +47,6 @@ where impl<'q, T> Encode<'q, Postgres> for &'_ [T] where T: Encode<'q, Postgres> + Type, - Self: Type, { fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull { buf.extend(&1_i32.to_be_bytes()); // number of dimensions @@ -77,7 +75,6 @@ where impl<'r, T> Decode<'r, Postgres> for Vec where T: for<'a> Decode<'a, Postgres> + Type, - Self: Type, { fn decode(value: PgValueRef<'r>) -> Result { let element_type_info; diff --git a/sqlx-core/src/types/json.rs b/sqlx-core/src/types/json.rs index 1d24ce3c88..5d3a74c320 100644 --- a/sqlx-core/src/types/json.rs +++ b/sqlx-core/src/types/json.rs @@ -86,7 +86,6 @@ where impl<'q, DB> Encode<'q, DB> for JsonValue where - Self: Type, for<'a> Json<&'a Self>: Encode<'q, DB>, DB: Database, { @@ -97,7 +96,6 @@ where impl<'r, DB> Decode<'r, DB> for JsonValue where - Self: Type, Json: Decode<'r, DB>, DB: Database, { @@ -124,7 +122,6 @@ where // implementation for Encode impl<'r, DB> Decode<'r, DB> for &'r JsonRawValue where - Self: Type, Json: Decode<'r, DB>, DB: Database, {