|
1 | 1 | extern crate chrono; |
2 | 2 |
|
3 | 3 | use postgres_protocol::types; |
4 | | -use self::chrono::{Duration, NaiveDate, NaiveTime, NaiveDateTime, DateTime, Utc, Local, |
5 | | - FixedOffset}; |
| 4 | +use self::chrono::{DateTime, Duration, FixedOffset, Local, NaiveDate, NaiveDateTime, NaiveTime, |
| 5 | + Utc}; |
6 | 6 | use std::error::Error; |
7 | 7 |
|
8 | | -use types::{FromSql, ToSql, IsNull, Type, TIMESTAMP, TIMESTAMPTZ, DATE, TIME}; |
| 8 | +use types::{FromSql, IsNull, ToSql, Type, DATE, TIME, TIMESTAMP, TIMESTAMPTZ}; |
9 | 9 |
|
10 | 10 | fn base() -> NaiveDateTime { |
11 | 11 | NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0) |
@@ -62,11 +62,7 @@ impl FromSql for DateTime<Local> { |
62 | 62 | } |
63 | 63 |
|
64 | 64 | impl ToSql for DateTime<Local> { |
65 | | - fn to_sql( |
66 | | - &self, |
67 | | - type_: &Type, |
68 | | - mut w: &mut Vec<u8>, |
69 | | - ) -> Result<IsNull, Box<Error + Sync + Send>> { |
| 65 | + fn to_sql(&self, type_: &Type, w: &mut Vec<u8>) -> Result<IsNull, Box<Error + Sync + Send>> { |
70 | 66 | self.with_timezone(&Utc).to_sql(type_, w) |
71 | 67 | } |
72 | 68 |
|
|
0 commit comments