diff rust/src/fridge.rs @ 626:efcbe0d3afd6 rust

fix to work with hyper
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Dec 2017 00:09:45 +0800
parents 8136a6b99866
children e1b5938de122
line wrap: on
line diff
--- a/rust/src/fridge.rs	Wed Dec 06 00:08:46 2017 +0800
+++ b/rust/src/fridge.rs	Wed Dec 06 00:09:45 2017 +0800
@@ -1,6 +1,6 @@
 extern crate futures;
 extern crate tokio_core;
-#[cfg(linux)]
+#[cfg(target_os = "linux")]
 extern crate sysfs_gpio;
 
 use std;
@@ -14,7 +14,7 @@
 use futures::sync::{mpsc};
 
 #[cfg(target_os = "linux")]
-use sysfs_gpio::{Direction, Pin};
+use self::sysfs_gpio::{Direction, Pin};
 
 use config::Config;
 use params::Params;
@@ -138,11 +138,10 @@
     /// All specified in next_wakeup()
     pub fn wakeups(&mut self)
             -> Box<Stream<Item=Message, Error=TemplogError>> {
-        mem::replace(&mut self.timeout_r, None)
+        Box::new(mem::replace(&mut self.timeout_r, None)
             .expect("Fridge::wakeups() can only be called once")
             .map(|v| Message::Tick(v))
-            .map_err(|e| TemplogError::new("wakeups() receive failed"))
-            .boxed()
+            .map_err(|e| TemplogError::new("wakeups() receive failed")))
     }
 
     fn turn_off(&mut self) {