Skip to content

Commit 7c3b76b

Browse files
committed
chore: remove conflicting impls
1 parent 889f67c commit 7c3b76b

File tree

6 files changed

+1
-66
lines changed

6 files changed

+1
-66
lines changed

sqlx-core/src/types/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ impl<T, DB: Database> Type<DB> for Cow<'_, T>
270270
where
271271
T: Type<DB>,
272272
T: ToOwned<Owned = T>,
273+
T: ?Sized,
273274
{
274275
fn type_info() -> DB::TypeInfo {
275276
<T as Type<DB>>::type_info()

sqlx-mysql/src/types/bytes.rs

-10
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ impl<'r> Decode<'r, MySql> for &'r [u8] {
4040
}
4141
}
4242

43-
impl Type<MySql> for Box<[u8]> {
44-
fn type_info() -> MySqlTypeInfo {
45-
<&[u8] as Type<MySql>>::type_info()
46-
}
47-
48-
fn compatible(ty: &MySqlTypeInfo) -> bool {
49-
<&[u8] as Type<MySql>>::compatible(ty)
50-
}
51-
}
52-
5343
impl Encode<'_, MySql> for Box<[u8]> {
5444
fn encode_by_ref(&self, buf: &mut Vec<u8>) -> Result<IsNull, BoxDynError> {
5545
<&[u8] as Encode<MySql>>::encode(self.as_ref(), buf)

sqlx-mysql/src/types/str.rs

-20
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ impl<'r> Decode<'r, MySql> for &'r str {
4646
}
4747
}
4848

49-
impl Type<MySql> for Box<str> {
50-
fn type_info() -> MySqlTypeInfo {
51-
<&str as Type<MySql>>::type_info()
52-
}
53-
54-
fn compatible(ty: &MySqlTypeInfo) -> bool {
55-
<&str as Type<MySql>>::compatible(ty)
56-
}
57-
}
58-
5949
impl Encode<'_, MySql> for Box<str> {
6050
fn encode_by_ref(&self, buf: &mut Vec<u8>) -> Result<IsNull, BoxDynError> {
6151
<&str as Encode<MySql>>::encode(&**self, buf)
@@ -90,16 +80,6 @@ impl Decode<'_, MySql> for String {
9080
}
9181
}
9282

93-
impl Type<MySql> for Cow<'_, str> {
94-
fn type_info() -> MySqlTypeInfo {
95-
<&str as Type<MySql>>::type_info()
96-
}
97-
98-
fn compatible(ty: &MySqlTypeInfo) -> bool {
99-
<&str as Type<MySql>>::compatible(ty)
100-
}
101-
}
102-
10383
impl Encode<'_, MySql> for Cow<'_, str> {
10484
fn encode_by_ref(&self, buf: &mut Vec<u8>) -> Result<IsNull, BoxDynError> {
10585
match self {

sqlx-postgres/src/types/str.rs

-10
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ impl Type<Postgres> for str {
2424
}
2525
}
2626

27-
impl Type<Postgres> for Cow<'_, str> {
28-
fn type_info() -> PgTypeInfo {
29-
<&str as Type<Postgres>>::type_info()
30-
}
31-
32-
fn compatible(ty: &PgTypeInfo) -> bool {
33-
<&str as Type<Postgres>>::compatible(ty)
34-
}
35-
}
36-
3727
impl Type<Postgres> for String {
3828
fn type_info() -> PgTypeInfo {
3929
<&str as Type<Postgres>>::type_info()

sqlx-sqlite/src/types/bytes.rs

-10
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ impl<'r> Decode<'r, Sqlite> for &'r [u8] {
3434
}
3535
}
3636

37-
impl Type<Sqlite> for Box<[u8]> {
38-
fn type_info() -> SqliteTypeInfo {
39-
<&[u8] as Type<Sqlite>>::type_info()
40-
}
41-
42-
fn compatible(ty: &SqliteTypeInfo) -> bool {
43-
<&[u8] as Type<Sqlite>>::compatible(ty)
44-
}
45-
}
46-
4737
impl Encode<'_, Sqlite> for Box<[u8]> {
4838
fn encode(self, args: &mut Vec<SqliteArgumentValue<'_>>) -> Result<IsNull, BoxDynError> {
4939
args.push(SqliteArgumentValue::Blob(Cow::Owned(self.into_vec())));

sqlx-sqlite/src/types/str.rs

-16
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ impl<'r> Decode<'r, Sqlite> for &'r str {
3030
}
3131
}
3232

33-
impl Type<Sqlite> for Box<str> {
34-
fn type_info() -> SqliteTypeInfo {
35-
<&str as Type<Sqlite>>::type_info()
36-
}
37-
}
38-
3933
impl Encode<'_, Sqlite> for Box<str> {
4034
fn encode(self, args: &mut Vec<SqliteArgumentValue<'_>>) -> Result<IsNull, BoxDynError> {
4135
args.push(SqliteArgumentValue::Text(Cow::Owned(self.into_string())));
@@ -90,16 +84,6 @@ impl<'r> Decode<'r, Sqlite> for String {
9084
}
9185
}
9286

93-
impl Type<Sqlite> for Cow<'_, str> {
94-
fn type_info() -> SqliteTypeInfo {
95-
<&str as Type<Sqlite>>::type_info()
96-
}
97-
98-
fn compatible(ty: &SqliteTypeInfo) -> bool {
99-
<&str as Type<Sqlite>>::compatible(ty)
100-
}
101-
}
102-
10387
impl<'q> Encode<'q, Sqlite> for Cow<'q, str> {
10488
fn encode(self, args: &mut Vec<SqliteArgumentValue<'q>>) -> Result<IsNull, BoxDynError> {
10589
args.push(SqliteArgumentValue::Text(self));

0 commit comments

Comments
 (0)