Fix CIDR[] not being compatible with Vec<IpNetwork> (#1433)

This commit is contained in:
Paolo Barbolini
2021-09-11 00:43:04 +02:00
committed by GitHub
parent bb33a296cb
commit 092f811f62

View File

@@ -38,6 +38,10 @@ impl Type<Postgres> for [IpNetwork] {
fn type_info() -> PgTypeInfo {
PgTypeInfo::INET_ARRAY
}
fn compatible(ty: &PgTypeInfo) -> bool {
*ty == PgTypeInfo::CIDR_ARRAY || *ty == PgTypeInfo::INET_ARRAY
}
}
impl Type<Postgres> for Vec<IpNetwork> {