Skip to content

Commit

Permalink
Fix CIDR[] not being compatible with Vec<IpNetwork> (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini authored Sep 10, 2021
1 parent bb33a29 commit 092f811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqlx-core/src/postgres/types/ipnetwork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 092f811

Please sign in to comment.