(clippy) some small clippy fixes (#28)
Reviewed-on: #28 Co-authored-by: ddidderr <ddidderr@paul.network> Co-committed-by: ddidderr <ddidderr@paul.network>
This commit is contained in:
parent
d0e4bea3e8
commit
d491ea12a5
20
src/proto.rs
20
src/proto.rs
@ -332,7 +332,7 @@ mod tests {
|
||||
let invalid_rcodes = [11, 12, 13, 14, 15];
|
||||
|
||||
for rcode in invalid_rcodes {
|
||||
dns_query[3] = (rcode as u8) << 0;
|
||||
dns_query[3] = rcode;
|
||||
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
|
||||
@ -368,7 +368,7 @@ mod tests {
|
||||
];
|
||||
|
||||
for (rcode, parsed_rcode) in valid_rcodes {
|
||||
dns_query[3] = rcode << 0;
|
||||
dns_query[3] = rcode;
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(
|
||||
parse_result?.response_code, parsed_rcode,
|
||||
@ -525,7 +525,7 @@ mod tests {
|
||||
0xff, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.authorative_answer, true);
|
||||
assert!(parse_result?.authorative_answer);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ mod tests {
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.authorative_answer, false);
|
||||
assert!(!parse_result?.authorative_answer);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -549,7 +549,7 @@ mod tests {
|
||||
0xff, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.truncated, true);
|
||||
assert!(parse_result?.truncated);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -559,7 +559,7 @@ mod tests {
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.truncated, false);
|
||||
assert!(!parse_result?.truncated);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -573,7 +573,7 @@ mod tests {
|
||||
0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.recursion_desired, true);
|
||||
assert!(parse_result?.recursion_desired);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ mod tests {
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.recursion_desired, false);
|
||||
assert!(!parse_result?.recursion_desired);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -597,7 +597,7 @@ mod tests {
|
||||
0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.recursion_available, true);
|
||||
assert!(parse_result?.recursion_available);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -607,7 +607,7 @@ mod tests {
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
];
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.recursion_available, false);
|
||||
assert!(!parse_result?.recursion_available);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user