about summary refs log tree commit diff
path: root/src/libstd/sys/unix/timer.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-12-30 10:51:18 -0800
committerAaron Turon <aturon@mozilla.com>2014-12-30 17:06:08 -0800
commit6abfac083feafc73e5d736177755cce3bfb7153f (patch)
treed5502fab0dd68ea96057616eb20d90a2c9050218 /src/libstd/sys/unix/timer.rs
parent6e1879eaf1cb5e727eb134a3e27018f7535852eb (diff)
downloadrust-6abfac083feafc73e5d736177755cce3bfb7153f.tar.gz
rust-6abfac083feafc73e5d736177755cce3bfb7153f.zip
Fallout from stabilization
Diffstat (limited to 'src/libstd/sys/unix/timer.rs')
-rw-r--r--src/libstd/sys/unix/timer.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs
index fe393b81e3d..c0ef89666c0 100644
--- a/src/libstd/sys/unix/timer.rs
+++ b/src/libstd/sys/unix/timer.rs
@@ -120,9 +120,9 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
     // signals the first requests in the queue, possible re-enqueueing it.
     fn signal(active: &mut Vec<Box<Inner>>,
               dead: &mut Vec<(uint, Box<Inner>)>) {
-        let mut timer = match active.remove(0) {
-            Some(timer) => timer, None => return
-        };
+        if active.is_empty() { return }
+
+        let mut timer = active.remove(0);
         let mut cb = timer.cb.take().unwrap();
         cb.call();
         if timer.repeat {
@@ -178,7 +178,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
                         Ok(RemoveTimer(id, ack)) => {
                             match dead.iter().position(|&(i, _)| id == i) {
                                 Some(i) => {
-                                    let (_, i) = dead.remove(i).unwrap();
+                                    let (_, i) = dead.remove(i);
                                     ack.send(i);
                                     continue
                                 }
@@ -186,7 +186,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
                             }
                             let i = active.iter().position(|i| i.id == id);
                             let i = i.expect("no timer found");
-                            let t = active.remove(i).unwrap();
+                            let t = active.remove(i);
                             ack.send(t);
                         }
                         Err(..) => break