Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scylla-cql: Use #[cfg(feature = "time")] for time related impl SerializeCql's #898

Merged
merged 2 commits into from Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Expand Up @@ -34,6 +34,12 @@ jobs:
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
- name: Cargo check with all serialization features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "full-serialization"
- name: Cargo check with secret feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secret"
- name: Cargo check with chrono feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "chrono"
- name: Cargo check with time feature
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "time"
- name: Build scylla-cql
run: cargo build --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml" --features "full-serialization"
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions scylla-cql/src/types/serialize/value.rs
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