diff --git a/examples/sample1.rs b/examples/sample1.rs index 1982113..9ce20a4 100644 --- a/examples/sample1.rs +++ b/examples/sample1.rs @@ -300,10 +300,7 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { - DnsQuestion { - name, - qtype, - } + DnsQuestion { name, qtype } } pub fn read(&mut self, buffer: &mut BytePacketBuffer) -> Result<()> { @@ -352,11 +349,7 @@ impl DnsRecord { ((raw_addr >> 0) & 0xFF) as u8, ); - Ok(DnsRecord::A { - domain, - addr, - ttl, - }) + Ok(DnsRecord::A { domain, addr, ttl }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; diff --git a/examples/sample2.rs b/examples/sample2.rs index aea9745..b754d81 100644 --- a/examples/sample2.rs +++ b/examples/sample2.rs @@ -336,10 +336,7 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { - DnsQuestion { - name, - qtype, - } + DnsQuestion { name, qtype } } pub fn read(&mut self, buffer: &mut BytePacketBuffer) -> Result<()> { @@ -398,11 +395,7 @@ impl DnsRecord { ((raw_addr >> 0) & 0xFF) as u8, ); - Ok(DnsRecord::A { - domain, - addr, - ttl, - }) + Ok(DnsRecord::A { domain, addr, ttl }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; diff --git a/examples/sample3.rs b/examples/sample3.rs index f074ecf..32a3001 100644 --- a/examples/sample3.rs +++ b/examples/sample3.rs @@ -361,10 +361,7 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { - DnsQuestion { - name, - qtype, - } + DnsQuestion { name, qtype } } pub fn read(&mut self, buffer: &mut BytePacketBuffer) -> Result<()> { @@ -444,11 +441,7 @@ impl DnsRecord { ((raw_addr >> 0) & 0xFF) as u8, ); - Ok(DnsRecord::A { - domain, - addr, - ttl, - }) + Ok(DnsRecord::A { domain, addr, ttl }) } QueryType::AAAA => { let raw_addr1 = buffer.read_u32()?; @@ -466,11 +459,7 @@ impl DnsRecord { ((raw_addr4 >> 0) & 0xFFFF) as u16, ); - Ok(DnsRecord::AAAA { - domain, - addr, - ttl, - }) + Ok(DnsRecord::AAAA { domain, addr, ttl }) } QueryType::NS => { let mut ns = String::new(); diff --git a/examples/sample4.rs b/examples/sample4.rs index b828563..a648131 100644 --- a/examples/sample4.rs +++ b/examples/sample4.rs @@ -361,10 +361,7 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { - DnsQuestion { - name, - qtype, - } + DnsQuestion { name, qtype } } pub fn read(&mut self, buffer: &mut BytePacketBuffer) -> Result<()> { @@ -444,11 +441,7 @@ impl DnsRecord { ((raw_addr >> 0) & 0xFF) as u8, ); - Ok(DnsRecord::A { - domain, - addr, - ttl, - }) + Ok(DnsRecord::A { domain, addr, ttl }) } QueryType::AAAA => { let raw_addr1 = buffer.read_u32()?; @@ -466,11 +459,7 @@ impl DnsRecord { ((raw_addr4 >> 0) & 0xFFFF) as u16, ); - Ok(DnsRecord::AAAA { - domain, - addr, - ttl, - }) + Ok(DnsRecord::AAAA { domain, addr, ttl }) } QueryType::NS => { let mut ns = String::new(); @@ -793,7 +782,7 @@ fn main() -> Result<()> { // requests is initiated. loop { match handle_query(&socket) { - Ok(_) => {}, + Ok(_) => {} Err(e) => eprintln!("An error occurred: {}", e), } } diff --git a/examples/sample5.rs b/examples/sample5.rs index b2859c1..40555c9 100644 --- a/examples/sample5.rs +++ b/examples/sample5.rs @@ -361,10 +361,7 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { - DnsQuestion { - name, - qtype, - } + DnsQuestion { name, qtype } } pub fn read(&mut self, buffer: &mut BytePacketBuffer) -> Result<()> { @@ -444,11 +441,7 @@ impl DnsRecord { ((raw_addr >> 0) & 0xFF) as u8, ); - Ok(DnsRecord::A { - domain, - addr, - ttl, - }) + Ok(DnsRecord::A { domain, addr, ttl }) } QueryType::AAAA => { let raw_addr1 = buffer.read_u32()?; @@ -466,11 +459,7 @@ impl DnsRecord { ((raw_addr4 >> 0) & 0xFFFF) as u16, ); - Ok(DnsRecord::AAAA { - domain, - addr, - ttl, - }) + Ok(DnsRecord::AAAA { domain, addr, ttl }) } QueryType::NS => { let mut ns = String::new(); @@ -886,7 +875,7 @@ fn main() -> Result<()> { loop { match handle_query(&socket) { - Ok(_) => {}, + Ok(_) => {} Err(e) => eprintln!("An error occurred: {}", e), } }