aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-14 22:41:25 +0200
committeracdenisSK <[email protected]>2017-10-14 22:41:25 +0200
commitcae014758a1d1e926a71679f02e32601c57f8d52 (patch)
tree39270dbc2df916a91c3c4272600fd082a2604516 /src/internal
parentSwitch to parking_lot::{Mutex, RwLock} (diff)
parentRelease v0.4.1 (diff)
downloadserenity-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.rs7
-rw-r--r--src/internal/timer.rs4
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 {