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

Remove ToTokens for PgInterval #710

Merged
merged 1 commit into from
Oct 4, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ postgres-types = { version = "0", default-features = false, optional = true }
rust_decimal = { version = "1", default-features = false, optional = true }
bigdecimal = { version = "0.3", default-features = false, optional = true }
uuid = { version = "1", default-features = false, optional = true }
proc-macro2 = { version = "1", default-features = false, optional = true }
quote = { version = "1", default-features = false, optional = true }
time = { version = "0.3", default-features = false, optional = true, features = ["macros", "formatting"] }
ipnetwork = { version = "0.20", default-features = false, optional = true }
mac_address = { version = "1.1", default-features = false, optional = true }
Expand All @@ -60,7 +58,7 @@ derive = ["sea-query-derive"]
attr = ["sea-query-attr"]
hashable-value = ["derivative", "ordered-float"]
postgres-array = []
postgres-interval = ["proc-macro2", "quote"]
postgres-interval = []
thread-safe = []
with-chrono = ["chrono"]
with-json = ["serde_json"]
Expand Down
22 changes: 0 additions & 22 deletions src/table/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,6 @@ pub enum BlobSize {
Long,
}

#[cfg(feature = "postgres-interval")]
impl quote::ToTokens for PgInterval {
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
use quote::{quote, TokenStreamExt};
tokens.append_all(match self {
PgInterval::Year => quote! { PgInterval::Year },
PgInterval::Month => quote! { PgInterval::Month },
PgInterval::Day => quote! { PgInterval::Day },
PgInterval::Hour => quote! { PgInterval::Hour },
PgInterval::Minute => quote! { PgInterval::Minute },
PgInterval::Second => quote! { PgInterval::Second },
PgInterval::YearToMonth => quote! { PgInterval::YearToMonth },
PgInterval::DayToHour => quote! { PgInterval::DayToHour },
PgInterval::DayToMinute => quote! { PgInterval::DayToMinute },
PgInterval::DayToSecond => quote! { PgInterval::DayToSecond },
PgInterval::HourToMinute => quote! { PgInterval::HourToMinute },
PgInterval::HourToSecond => quote! { PgInterval::HourToSecond },
PgInterval::MinuteToSecond => quote! { PgInterval::MinuteToSecond },
});
}
}

impl ColumnDef {
/// Construct a table column
pub fn new<T>(name: T) -> Self
Expand Down
36 changes: 0 additions & 36 deletions tests/postgres/interval.rs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/postgres/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use sea_query::{tests_cfg::*, *};

mod foreign_key;
mod index;
#[cfg(feature = "postgres-interval")]
mod interval;
mod query;
mod table;
mod types;
Expand Down