From 76dc8367f70334991665a143ea04e1e50655f988 Mon Sep 17 00:00:00 2001 From: "Alex M. M." Date: Mon, 23 Sep 2024 18:25:52 +0200 Subject: [PATCH] Remove `#[cfg(...)]`s mentioning the `time` feature The `time` crate, alongside its corresponding `time` feature, is no longer used by poise anymore. Code that branches whether we're using `chrono` or `time` can simply check just for `chrono`. --- src/builtins/mod.rs | 4 ++-- src/structs/context.rs | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/builtins/mod.rs b/src/builtins/mod.rs index 457610e6dd0c..45e8082563f6 100644 --- a/src/builtins/mod.rs +++ b/src/builtins/mod.rs @@ -12,9 +12,9 @@ pub use pretty_help::*; mod register; pub use register::*; -#[cfg(any(feature = "chrono", feature = "time"))] +#[cfg(feature = "chrono")] mod paginate; -#[cfg(any(feature = "chrono", feature = "time"))] +#[cfg(feature = "chrono")] pub use paginate::*; use crate::{serenity::CreateAllowedMentions, serenity_prelude as serenity, CreateReply}; diff --git a/src/structs/context.rs b/src/structs/context.rs index a9f0d99ff3f8..ad6d19ff4415 100644 --- a/src/structs/context.rs +++ b/src/structs/context.rs @@ -300,7 +300,7 @@ context_methods! { } /// Return a ID that uniquely identifies this command invocation. - #[cfg(any(feature = "chrono", feature = "time"))] + #[cfg(feature = "chrono")] (id self) (pub fn id(self) -> u64) { match self { @@ -316,11 +316,6 @@ context_methods! { // Calculate Discord's datetime representation (millis since Discord epoch) and // insert those bits into the ID - - #[cfg(feature = "time")] - let timestamp_millis = edited_timestamp.unix_timestamp_nanos() / 1_000_000; - - #[cfg(not(feature = "time"))] let timestamp_millis = edited_timestamp.timestamp_millis(); id |= ((timestamp_millis - 1420070400000) as u64) << 22;