diff rust/src/main.rs @ 611:f3e39e2107fd rust

still doesn't compile, improvements to TemplogError and tokio curl though
author Matt Johnston <matt@ucc.asn.au>
date Tue, 28 Feb 2017 22:58:47 +0800
parents 7bda01659426
children e1bab5b36352
line wrap: on
line diff
--- a/rust/src/main.rs	Thu Feb 23 23:27:09 2017 +0800
+++ b/rust/src/main.rs	Tue Feb 28 22:58:47 2017 +0800
@@ -7,6 +7,7 @@
 extern crate time;
 extern crate tokio_curl;
 extern crate curl;
+extern crate serde_json;
 
 #[macro_use] 
 extern crate lazy_static;
@@ -44,7 +45,7 @@
     let mut fridge = fridge::Fridge::new(&config, nowait, paramh.p, &handle);
 
     let (fridge_reading_s, fridge_reading_r) = mpsc::channel(1);
-    let fridge_reading_r = fridge_reading_r.map_err(|_| io::Error::new(io::ErrorKind::Other, "Problem with fridge_reading_r channel"));
+    let fridge_reading_r = fridge_reading_r.map_err(|e| TemplogError::new("Problem with fridge_reading_r channel"));
 
     let sensor_stream = if testmode {
         sensor::TestSensor::new(config).stream(&handle)
@@ -70,7 +71,7 @@
         r
     });
 
-    let param_stream = paramwaiter::ParamWaiter::stream(&handle);
+    let param_stream = paramwaiter::ParamWaiter::new(config, &handle).stream();
     let p = param_stream.map(|p| {
             fridge::Message::Params(p)
         });