Selaa lähdekoodia

rust-protocol: More #[derive]s (for hashing/comparison).

Mathias Gottschlag 5 vuotta sitten
vanhempi
commit
20571080a3
1 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 7
    7
      common/rust-protocol/src/lib.rs

+ 7
- 7
common/rust-protocol/src/lib.rs Näytä tiedosto

10
 use crc16::{State, KERMIT};
10
 use crc16::{State, KERMIT};
11
 use xxtea_nostd::{decrypt, encrypt};
11
 use xxtea_nostd::{decrypt, encrypt};
12
 
12
 
13
-#[derive(Debug, Clone, PartialEq)]
13
+#[derive(Debug, Clone, PartialEq, Eq)]
14
 pub enum Packet {
14
 pub enum Packet {
15
     GetSalt,
15
     GetSalt,
16
     Salt(u64),
16
     Salt(u64),
86
     }
86
     }
87
 }
87
 }
88
 
88
 
89
-#[derive(Debug, Clone, PartialEq)]
89
+#[derive(Debug, Clone, PartialEq, Eq)]
90
 pub struct Report {
90
 pub struct Report {
91
     pub count: u8,
91
     pub count: u8,
92
     pub values: [Value; 8],
92
     pub values: [Value; 8],
119
     }
119
     }
120
 }
120
 }
121
 
121
 
122
-#[derive(Debug, Clone, PartialEq)]
122
+#[derive(Debug, Clone, PartialEq, Eq)]
123
 pub struct GetValues {
123
 pub struct GetValues {
124
     pub count: u8,
124
     pub count: u8,
125
     pub location: Location,
125
     pub location: Location,
138
     }
138
     }
139
 }
139
 }
140
 
140
 
141
-#[derive(Debug, Clone, PartialEq)]
141
+#[derive(Debug, Clone, PartialEq, Eq)]
142
 pub struct Values {
142
 pub struct Values {
143
     pub count: u8,
143
     pub count: u8,
144
     pub location: Location,
144
     pub location: Location,
157
     }
157
     }
158
 }
158
 }
159
 
159
 
160
-#[derive(Debug, Clone, Copy, PartialEq)]
160
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
161
 pub enum Location {
161
 pub enum Location {
162
     Livingroom,
162
     Livingroom,
163
     Bathroom,
163
     Bathroom,
166
     Balcony,
166
     Balcony,
167
 }
167
 }
168
 
168
 
169
-#[derive(Debug, Clone, Copy, PartialEq)]
169
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
170
 pub enum Value {
170
 pub enum Value {
171
     Invalid,
171
     Invalid,
172
     Time(u64),
172
     Time(u64),
252
     }
252
     }
253
 }
253
 }
254
 
254
 
255
-#[derive(Debug, Clone, Copy, PartialEq)]
255
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
256
 pub enum ValueType {
256
 pub enum ValueType {
257
     Time,
257
     Time,
258
     Temperature,
258
     Temperature,

Loading…
Peruuta
Tallenna