Skip to content

Commit

Permalink
scylla-cql: Use #[cfg(feature = "time")] for time related `impl S…
Browse files Browse the repository at this point in the history
…erializeCql`'s

Fixes #897
  • Loading branch information
oeb25 committed Dec 28, 2023
1 parent 4a4fd0e commit 5714db1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scylla-cql/src/types/serialize/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,21 @@ impl SerializeCql for NaiveTime {
<CqlTime as SerializeCql>::serialize(&cql_time, typ, writer)?
});
}
#[cfg(feature = "chrono")]
#[cfg(feature = "time")]
impl SerializeCql for time::Date {
impl_serialize_via_writer!(|me, typ, writer| {
exact_type_check!(typ, Date);
<CqlDate as SerializeCql>::serialize(&(*me).into(), typ, writer)?
});
}
#[cfg(feature = "chrono")]
#[cfg(feature = "time")]
impl SerializeCql for time::OffsetDateTime {
impl_serialize_via_writer!(|me, typ, writer| {
exact_type_check!(typ, Timestamp);
<CqlTimestamp as SerializeCql>::serialize(&(*me).into(), typ, writer)?
});
}
#[cfg(feature = "chrono")]
#[cfg(feature = "time")]
impl SerializeCql for time::Time {
impl_serialize_via_writer!(|me, typ, writer| {
exact_type_check!(typ, Time);
Expand Down

0 comments on commit 5714db1

Please sign in to comment.