diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-21 15:18:46 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-21 15:18:46 -0700 |
| commit | 45868cd2cedd6bd418ea1c1d795a74c0ef6af975 (patch) | |
| tree | 7f0a78158e24073606c0abed6c575e25e91c0b5e /src/internal/timer.rs | |
| parent | Extract Discord close codes to constants (diff) | |
| download | serenity-45868cd2cedd6bd418ea1c1d795a74c0ef6af975.tar.xz serenity-45868cd2cedd6bd418ea1c1d795a74c0ef6af975.zip | |
Update dependencies
Diffstat (limited to 'src/internal/timer.rs')
| -rw-r--r-- | src/internal/timer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/internal/timer.rs b/src/internal/timer.rs index 677ece1..1b51dda 100644 --- a/src/internal/timer.rs +++ b/src/internal/timer.rs @@ -1,9 +1,9 @@ -use chrono::{DateTime, Duration, UTC}; +use chrono::{DateTime, Duration, Utc}; use std::thread; use std::time::Duration as StdDuration; pub struct Timer { - due: DateTime<UTC>, + due: DateTime<Utc>, duration: Duration, } @@ -12,7 +12,7 @@ impl Timer { let duration = Duration::milliseconds(duration_in_ms as i64); Timer { - due: UTC::now() + duration, + due: Utc::now() + duration, duration: duration, } } @@ -20,7 +20,7 @@ impl Timer { pub fn await(&mut self) { let due_time = (self.due.timestamp() * 1000) + self.due.timestamp_subsec_millis() as i64; let now_time = { - let now = UTC::now(); + let now = Utc::now(); (now.timestamp() * 1000) + now.timestamp_subsec_millis() as i64 }; @@ -37,7 +37,7 @@ impl Timer { } pub fn check(&mut self) -> bool { - if UTC::now() >= self.due { + if Utc::now() >= self.due { self.due = self.due + self.duration; true @@ -47,6 +47,6 @@ impl Timer { } pub fn reset(&mut self) { - self.due = UTC::now() + self.duration; + self.due = Utc::now() + self.duration; } } |