Skip to content

Commit 81455f1

Browse files
committed
Update to work with postgres 0.15; Bump version
1 parent cf32631 commit 81455f1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-inet"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
authors = ["Nuew <[email protected]>"]
55
license = "Apache-2.0"
66
description = "Cidr and Inet support for postgres (unofficial)"
@@ -15,4 +15,4 @@ travis-ci = { repository = "nuew/postgres-inet", branch = "master" }
1515
[dependencies]
1616
byteorder = "1.0"
1717
libc = "0.2"
18-
postgres = "0.14"
18+
postgres = "0.15"

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//!
2222
//! [1]: https://crates.io/crates/postgres
2323
//! [2]: https://github.com/sfackler
24-
#![doc(html_root_url="https://docs.rs/postgres-inet/0.1.2")]
24+
#![doc(html_root_url="https://docs.rs/postgres-inet")]
2525
#![warn(missing_docs)]
2626

2727
#[macro_use]
@@ -32,7 +32,7 @@ extern crate libc;
3232

3333
mod tests;
3434

35-
use postgres::types::{Type, ToSql, FromSql, IsNull};
35+
use postgres::types::{self, Type, ToSql, FromSql, IsNull};
3636
use std::error::Error;
3737
use std::fmt;
3838
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
@@ -251,7 +251,7 @@ impl FromSql for MaskedIpAddr {
251251

252252
fn accepts(ty: &Type) -> bool {
253253
match *ty {
254-
Type::Cidr | Type::Inet => true,
254+
types::CIDR | types::INET => true,
255255
_ => false,
256256
}
257257
}
@@ -267,8 +267,8 @@ impl ToSql for MaskedIpAddr {
267267
});
268268
w.push(self.mask); // Subnet mask
269269
w.push(match *ty { // cidr
270-
Type::Cidr => true as u8,
271-
Type::Inet => false as u8,
270+
types::CIDR => true as u8,
271+
types::INET => false as u8,
272272
_ => unreachable!(),
273273
});
274274
w.push(match self.addr {
@@ -283,6 +283,6 @@ impl ToSql for MaskedIpAddr {
283283
Ok(IsNull::No)
284284
}
285285

286-
accepts!(Type::Cidr, Type::Inet);
286+
accepts!(types::CIDR, types::INET);
287287
to_sql_checked!();
288288
}

0 commit comments

Comments
 (0)