diff --git a/examples/sample1.rs b/examples/sample1.rs index c367fcb..1982113 100644 --- a/examples/sample1.rs +++ b/examples/sample1.rs @@ -301,8 +301,8 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { DnsQuestion { - name: name, - qtype: qtype, + name, + qtype, } } @@ -353,19 +353,19 @@ impl DnsRecord { ); Ok(DnsRecord::A { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; Ok(DnsRecord::UNKNOWN { - domain: domain, + domain, qtype: qtype_num, - data_len: data_len, - ttl: ttl, + data_len, + ttl, }) } } diff --git a/examples/sample2.rs b/examples/sample2.rs index 345291e..aea9745 100644 --- a/examples/sample2.rs +++ b/examples/sample2.rs @@ -337,8 +337,8 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { DnsQuestion { - name: name, - qtype: qtype, + name, + qtype, } } @@ -399,19 +399,19 @@ impl DnsRecord { ); Ok(DnsRecord::A { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; Ok(DnsRecord::UNKNOWN { - domain: domain, + domain, qtype: qtype_num, - data_len: data_len, - ttl: ttl, + data_len, + ttl, }) } } diff --git a/examples/sample3.rs b/examples/sample3.rs index fa8c18c..f074ecf 100644 --- a/examples/sample3.rs +++ b/examples/sample3.rs @@ -362,8 +362,8 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { DnsQuestion { - name: name, - qtype: qtype, + name, + qtype, } } @@ -445,9 +445,9 @@ impl DnsRecord { ); Ok(DnsRecord::A { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::AAAA => { @@ -467,9 +467,9 @@ impl DnsRecord { ); Ok(DnsRecord::AAAA { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::NS => { @@ -477,9 +477,9 @@ impl DnsRecord { buffer.read_qname(&mut ns)?; Ok(DnsRecord::NS { - domain: domain, + domain, host: ns, - ttl: ttl, + ttl, }) } QueryType::CNAME => { @@ -487,9 +487,9 @@ impl DnsRecord { buffer.read_qname(&mut cname)?; Ok(DnsRecord::CNAME { - domain: domain, + domain, host: cname, - ttl: ttl, + ttl, }) } QueryType::MX => { @@ -498,20 +498,20 @@ impl DnsRecord { buffer.read_qname(&mut mx)?; Ok(DnsRecord::MX { - domain: domain, - priority: priority, + domain, + priority, host: mx, - ttl: ttl, + ttl, }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; Ok(DnsRecord::UNKNOWN { - domain: domain, + domain, qtype: qtype_num, - data_len: data_len, - ttl: ttl, + data_len, + ttl, }) } } diff --git a/examples/sample4.rs b/examples/sample4.rs index cc680de..b828563 100644 --- a/examples/sample4.rs +++ b/examples/sample4.rs @@ -362,8 +362,8 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { DnsQuestion { - name: name, - qtype: qtype, + name, + qtype, } } @@ -445,9 +445,9 @@ impl DnsRecord { ); Ok(DnsRecord::A { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::AAAA => { @@ -467,9 +467,9 @@ impl DnsRecord { ); Ok(DnsRecord::AAAA { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::NS => { @@ -477,9 +477,9 @@ impl DnsRecord { buffer.read_qname(&mut ns)?; Ok(DnsRecord::NS { - domain: domain, + domain, host: ns, - ttl: ttl, + ttl, }) } QueryType::CNAME => { @@ -487,9 +487,9 @@ impl DnsRecord { buffer.read_qname(&mut cname)?; Ok(DnsRecord::CNAME { - domain: domain, + domain, host: cname, - ttl: ttl, + ttl, }) } QueryType::MX => { @@ -498,20 +498,20 @@ impl DnsRecord { buffer.read_qname(&mut mx)?; Ok(DnsRecord::MX { - domain: domain, - priority: priority, + domain, + priority, host: mx, - ttl: ttl, + ttl, }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; Ok(DnsRecord::UNKNOWN { - domain: domain, + domain, qtype: qtype_num, - data_len: data_len, - ttl: ttl, + data_len, + ttl, }) } } diff --git a/examples/sample5.rs b/examples/sample5.rs index 63268f8..b2859c1 100644 --- a/examples/sample5.rs +++ b/examples/sample5.rs @@ -362,8 +362,8 @@ pub struct DnsQuestion { impl DnsQuestion { pub fn new(name: String, qtype: QueryType) -> DnsQuestion { DnsQuestion { - name: name, - qtype: qtype, + name, + qtype, } } @@ -445,9 +445,9 @@ impl DnsRecord { ); Ok(DnsRecord::A { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::AAAA => { @@ -467,9 +467,9 @@ impl DnsRecord { ); Ok(DnsRecord::AAAA { - domain: domain, - addr: addr, - ttl: ttl, + domain, + addr, + ttl, }) } QueryType::NS => { @@ -477,9 +477,9 @@ impl DnsRecord { buffer.read_qname(&mut ns)?; Ok(DnsRecord::NS { - domain: domain, + domain, host: ns, - ttl: ttl, + ttl, }) } QueryType::CNAME => { @@ -487,9 +487,9 @@ impl DnsRecord { buffer.read_qname(&mut cname)?; Ok(DnsRecord::CNAME { - domain: domain, + domain, host: cname, - ttl: ttl, + ttl, }) } QueryType::MX => { @@ -498,20 +498,20 @@ impl DnsRecord { buffer.read_qname(&mut mx)?; Ok(DnsRecord::MX { - domain: domain, - priority: priority, + domain, + priority, host: mx, - ttl: ttl, + ttl, }) } QueryType::UNKNOWN(_) => { buffer.step(data_len as usize)?; Ok(DnsRecord::UNKNOWN { - domain: domain, + domain, qtype: qtype_num, - data_len: data_len, - ttl: ttl, + data_len, + ttl, }) } }