Skip to content

Commit 815a5d3

Browse files
committed
Remove impl for Zoned
`Timestamp` already has impl and is semantically accurate for mapping to `timestamptz`, unlike `Zoned`. End users can do their own conversions from `Timestamp` to `Zoned` if desired.
1 parent f00d208 commit 815a5d3

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

postgres-types/src/jiff_01.rs

-21
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,6 @@ impl ToSql for Timestamp {
5858
to_sql_checked!();
5959
}
6060

61-
impl<'a> FromSql<'a> for Zoned {
62-
fn from_sql(type_: &Type, raw: &[u8]) -> Result<Zoned, Box<dyn Error + Sync + Send>> {
63-
Ok(Timestamp::from_sql(type_, raw)?.to_zoned(TimeZone::UTC))
64-
}
65-
66-
accepts!(TIMESTAMPTZ);
67-
}
68-
69-
impl ToSql for Zoned {
70-
fn to_sql(
71-
&self,
72-
type_: &Type,
73-
w: &mut BytesMut,
74-
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
75-
self.timestamp().to_sql(type_, w)
76-
}
77-
78-
accepts!(TIMESTAMPTZ);
79-
to_sql_checked!();
80-
}
81-
8261
impl<'a> FromSql<'a> for Date {
8362
fn from_sql(_: &Type, raw: &[u8]) -> Result<Date, Box<dyn Error + Sync + Send>> {
8463
let jd = types::date_from_sql(raw)?;

0 commit comments

Comments
 (0)