Skip to content

Commit 6b2f26e

Browse files
committed
Fix feature'd impls
1 parent b34e5f3 commit 6b2f26e

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/types/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use serialize::json;
22

33
use {Result, Error};
4-
use types::{RawFromSql, RawToSql, Type};
4+
use types::{FromSql, RawToSql, Type};
55

66
impl FromSql for json::Json {
77
fn from_sql<R: Reader>(ty: &Type, raw: &mut R) -> Result<json::Json> {

src/types/time.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use time::Timespec;
22
use Result;
3-
use types::{RawFromSql, Type, RawToSql};
3+
use types::{Type, FromSql, RawToSql};
44

55
const USEC_PER_SEC: i64 = 1_000_000;
66
const NSEC_PER_USEC: i64 = 1_000;
77

88
// Number of seconds from 1970-01-01 to 2000-01-01
99
const TIME_SEC_CONVERSION: i64 = 946684800;
1010

11-
impl RawFromSql for Timespec {
12-
fn raw_from_sql<R: Reader>(_: &Type, raw: &mut R) -> Result<Timespec> {
11+
impl FromSql for Timespec {
12+
fn from_sql<R: Reader>(_: &Type, raw: &mut R) -> Result<Timespec> {
1313
let t = try!(raw.read_be_i64());
1414
let mut sec = t / USEC_PER_SEC + TIME_SEC_CONVERSION;
1515
let mut usec = t % USEC_PER_SEC;
@@ -21,9 +21,9 @@ impl RawFromSql for Timespec {
2121

2222
Ok(Timespec::new(sec, (usec * NSEC_PER_USEC) as i32))
2323
}
24-
}
2524

26-
from_raw_from_impl!(Type::Timestamp, Type::TimestampTZ; Timespec);
25+
accepts!(Type::Timestamp, Type::TimestampTZ);
26+
}
2727

2828
impl RawToSql for Timespec {
2929
fn raw_to_sql<W: Writer>(&self, _: &Type, w: &mut W) -> Result<()> {

src/types/uuid.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
extern crate uuid;
22

33
use self::uuid::Uuid;
4-
use types::{RawFromSql, ToSql, RawToSql, Type};
4+
use types::{FromSql, ToSql, RawToSql, Type};
55
use Error;
66
use Result;
77

8-
impl RawFromSql for Uuid {
9-
fn raw_from_sql<R: Reader>(_: &Type, raw: &mut R) -> Result<Uuid> {
8+
impl FromSql for Uuid {
9+
fn from_sql<R: Reader>(_: &Type, raw: &mut R) -> Result<Uuid> {
1010
match Uuid::from_bytes(&*try!(raw.read_to_end())) {
1111
Some(u) => Ok(u),
1212
None => Err(Error::BadResponse),
1313
}
1414
}
15-
}
1615

17-
from_raw_from_impl!(Type::Uuid; Uuid);
16+
accepts!(Type::Uuid);
17+
}
1818

1919
impl RawToSql for Uuid {
2020
fn raw_to_sql<W: Writer>(&self, _: &Type, w: &mut W) -> Result<()> {

0 commit comments

Comments
 (0)