Skip to content

Commit

Permalink
Remove ToTokens for PgInterval (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 authored Oct 4, 2023
1 parent 780b3db commit ed8d6a1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 63 deletions.
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

0 comments on commit ed8d6a1

Please sign in to comment.