comparison rust/src/sensor.rs @ 605:8dd63473b6d8 rust

config doesn't need Arc
author Matt Johnston <matt@ucc.asn.au>
date Fri, 17 Feb 2017 21:38:36 +0800
parents 278f1002b5c7
children 7bda01659426
comparison
equal deleted inserted replaced
604:278f1002b5c7 605:8dd63473b6d8
23 -> Box<Stream<Item=Readings, Error=io::Error>>; 23 -> Box<Stream<Item=Readings, Error=io::Error>>;
24 } 24 }
25 25
26 #[derive(Clone)] 26 #[derive(Clone)]
27 pub struct OneWireSensor { 27 pub struct OneWireSensor {
28 config: Arc<Config>, 28 config: Config,
29 } 29 }
30 30
31 impl OneWireSensor { 31 impl OneWireSensor {
32 pub fn new(config: &Config) -> Self { 32 pub fn new(config: &Config) -> Self {
33 OneWireSensor { 33 OneWireSensor {
34 config: Arc::new(config.clone()), 34 config: config.clone(),
35 } 35 }
36 } 36 }
37 37
38 fn step(&self) -> Readings { 38 fn step(&self) -> Readings {
39 let mut r = Readings::new(); 39 let mut r = Readings::new();