Quellcode durchsuchen

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

Mathias Gottschlag vor 5 Jahren
Ursprung
Commit
20571080a3
1 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
  1. 7
    7
      common/rust-protocol/src/lib.rs

+ 7
- 7
common/rust-protocol/src/lib.rs Datei anzeigen

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

Laden…
Abbrechen
Speichern