commit 54392742119035f6e7c17b896dc2c6f53eda6547
parent d46c1425e1623156954a13089067142db16a8ac9
Author: Daniel Barlow <dan@telent.net>
Date: Thu, 25 Dec 2025 16:34:22 +0000
group structs with their impl
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/ecu-esp32/src/wifi.rs b/ecu-esp32/src/wifi.rs
@@ -63,15 +63,7 @@ const CACHE_FLUSH : u16 = 1<<15;
// dns_protocol's ResourceRecord doesn't make a good representation for
// our needs because it doesn't own its "data" attribute - it's just a
-// reference. So we need something that can own the data
-
-struct DnsResource {
- name : String,
- ty : ResourceType,
- // class is always IN, ttl depends on the query
- data : RData,
- data_raw : Vec<u8>
-}
+// reference. So we need structures that can own the data
enum RData {
Raw(Vec<u8>),
@@ -100,6 +92,14 @@ fn rdata_to_bytes(rdata : &RData, out: &mut [u8]) {
}
+struct DnsResource {
+ name : String,
+ ty : ResourceType,
+ // class is always IN, ttl depends on the query
+ data : RData,
+ data_raw : Vec<u8>
+}
+
impl DnsResource {
fn new(
name: impl Into<String>,