Skip to content

Commit

Permalink
Remove #[cfg(...)]s mentioning the time feature
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
arqunis committed Sep 23, 2024
1 parent c8bbd91 commit 76dc836
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
7 changes: 1 addition & 6 deletions src/structs/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 76dc836

Please sign in to comment.