Change HasSqlType to Type

This commit is contained in:
Ryan Leckey
2020-03-20 19:55:47 -07:00
parent 9973fa6357
commit 13997ce957
5 changed files with 22 additions and 19 deletions

View File

@@ -19,9 +19,9 @@ impl Type<Postgres> for [bool] {
PgTypeInfo::new(TypeId::ARRAY_BOOL, "BOOL[]")
}
}
impl HasSqlType<Vec<bool>> for Postgres {
impl Type<Postgres> for Vec<bool> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[bool]>>::type_info()
<[bool] as Type<Postgres>>::type_info()
}
}

View File

@@ -22,9 +22,9 @@ impl Type<Postgres> for [f32] {
PgTypeInfo::new(TypeId::ARRAY_FLOAT4, "FLOAT4[]")
}
}
impl HasSqlType<Vec<f32>> for Postgres {
impl Type<Postgres> for Vec<f32> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[f32]>>::type_info()
<[f32] as Type<Postgres>>::type_info()
}
}
@@ -58,9 +58,9 @@ impl Type<Postgres> for [f64] {
PgTypeInfo::new(TypeId::ARRAY_FLOAT8, "FLOAT8[]")
}
}
impl HasSqlType<Vec<f64>> for Postgres {
impl Type<Postgres> for Vec<f64> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[f64]>>::type_info()
<[f64] as Type<Postgres>>::type_info()
}
}

View File

@@ -22,9 +22,9 @@ impl Type<Postgres> for [i16] {
PgTypeInfo::new(TypeId::ARRAY_INT2, "INT2[]")
}
}
impl HasSqlType<Vec<i16>> for Postgres {
impl Type<Postgres> for Vec<i16> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[i16]>>::type_info()
<[i16] as Type<Postgres>>::type_info()
}
}
@@ -54,9 +54,9 @@ impl Type<Postgres> for [i32] {
PgTypeInfo::new(TypeId::ARRAY_INT4, "INT4[]")
}
}
impl HasSqlType<Vec<i32>> for Postgres {
impl Type<Postgres> for Vec<i32> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[i32]>>::type_info()
<[i32] as Type<Postgres>>::type_info()
}
}
@@ -86,9 +86,9 @@ impl Type<Postgres> for [i64] {
PgTypeInfo::new(TypeId::ARRAY_INT8, "INT8[]")
}
}
impl HasSqlType<Vec<i64>> for Postgres {
impl Type<Postgres> for Vec<i64> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[i64]>>::type_info()
<[i64] as Type<Postgres>>::type_info()
}
}

View File

@@ -21,9 +21,10 @@ impl Type<Postgres> for [&'_ str] {
PgTypeInfo::new(TypeId::ARRAY_TEXT, "TEXT[]")
}
}
impl HasSqlType<Vec<&'_ str>> for Postgres {
impl Type<Postgres> for Vec<&'_ str> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[&'_ str]>>::type_info()
<[&'_ str] as Type<Postgres>>::type_info()
}
}
@@ -32,14 +33,16 @@ impl Type<Postgres> for String {
<str as Type<Postgres>>::type_info()
}
}
impl HasSqlType<[String]> for Postgres {
impl Type<Postgres> for [String] {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<[&'_ str]>>::type_info()
<[&'_ str] as Type<Postgres>>::type_info()
}
}
impl HasSqlType<Vec<String>> for Postgres {
impl Type<Postgres> for Vec<String> {
fn type_info() -> PgTypeInfo {
<Self as HasSqlType<Vec<&'_ str>>>::type_info()
<Vec<&'_ str> as Type<Postgres>>::type_info()
}
}

View File

@@ -23,7 +23,7 @@ impl Type<Postgres> for [Uuid] {
}
}
impl HasSqlType<Vec<Uuid>> for Postgres {
impl Type<Postgres> for Vec<Uuid> {
fn type_info() -> PgTypeInfo {
<Postgres as HasSqlType<[Uuid]>>::type_info()
}