diff options
| author | acdenisSK <[email protected]> | 2017-10-14 22:41:25 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-10-14 22:41:25 +0200 |
| commit | cae014758a1d1e926a71679f02e32601c57f8d52 (patch) | |
| tree | 39270dbc2df916a91c3c4272600fd082a2604516 /src/internal | |
| parent | Switch to parking_lot::{Mutex, RwLock} (diff) | |
| parent | Release v0.4.1 (diff) | |
| download | serenity-cae014758a1d1e926a71679f02e32601c57f8d52.tar.xz serenity-cae014758a1d1e926a71679f02e32601c57f8d52.zip | |
Update to account for changes made in 0.4.1
Diffstat (limited to 'src/internal')
| -rw-r--r-- | src/internal/macros.rs | 7 | ||||
| -rw-r--r-- | src/internal/timer.rs | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/internal/macros.rs b/src/internal/macros.rs index 4ee43d3..92a21c1 100644 --- a/src/internal/macros.rs +++ b/src/internal/macros.rs @@ -181,3 +181,10 @@ macro_rules! enum_number { } } } + +macro_rules! try_opt { + ($x:expr) => (match $x { + Some(v) => v, + None => return None, + }); +} diff --git a/src/internal/timer.rs b/src/internal/timer.rs index 0bd0d13..6a8bf74 100644 --- a/src/internal/timer.rs +++ b/src/internal/timer.rs @@ -18,11 +18,11 @@ impl Timer { } pub fn await(&mut self) { - let due_time = (self.due.timestamp() * 1000) + self.due.timestamp_subsec_millis() as i64; + let due_time = (self.due.timestamp() * 1000) + i64::from(self.due.timestamp_subsec_millis()); let now_time = { let now = Utc::now(); - (now.timestamp() * 1000) + now.timestamp_subsec_millis() as i64 + (now.timestamp() * 1000) + i64::from(now.timestamp_subsec_millis()) }; if due_time > now_time { |