Skip to content

Commit

Permalink
Apply suggestions from clippy 1.84
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jan 9, 2025
1 parent 2842002 commit ac5cf90
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/proto/src/dnssec/dnssec_dns_handle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ pub fn verify_nsec(query: &Query, soa_name: &Name, nsecs: &[&Record]) -> Proof {
.data()
.as_dnssec()
.and_then(DNSSECRData::as_nsec)
.map_or(false, |rdata| {
.is_some_and(|rdata| {
// this should not be in the covered list
!rdata.type_bit_maps().contains(&query.query_type())
})
Expand All @@ -1161,7 +1161,7 @@ pub fn verify_nsec(query: &Query, soa_name: &Name, nsecs: &[&Record]) -> Proof {
nsec.data()
.as_dnssec()
.and_then(DNSSECRData::as_nsec)
.map_or(false, |rdata| {
.is_some_and(|rdata| {
// the query name is less than the next name
// or this record wraps the end, i.e. is the last record
name < rdata.next_domain_name() || rdata.next_domain_name() < nsec.name()
Expand Down
2 changes: 1 addition & 1 deletion crates/proto/src/rr/domain/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ impl Name {
/// assert!(!name.is_wildcard());
/// ```
pub fn is_wildcard(&self) -> bool {
self.iter().next().map_or(false, |l| l == b"*")
self.iter().next().is_some_and(|l| l == b"*")
}

/// Converts a name to a wildcard, by replacing the first label with `*`
Expand Down
2 changes: 1 addition & 1 deletion crates/proto/src/xfer/dns_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl DnsResponse {
pub fn negative_type(&self) -> Option<NegativeType> {
let response_code = self.response_code();
let ttl_from_soa = self.negative_ttl();
let has_soa = ttl_from_soa.map_or(false, |_| true);
let has_soa = ttl_from_soa.is_some();
let has_ns_records = self.name_servers().iter().any(|r| r.record_type().is_ns());
let has_cname = self.answers().iter().any(|r| r.record_type().is_cname());
let has_non_cname = self.answers().iter().any(|r| !r.record_type().is_cname());
Expand Down
2 changes: 1 addition & 1 deletion crates/server/src/authority/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl Catalog {
}
}

async fn lookup<'a, R: ResponseHandler + Unpin>(
async fn lookup<R: ResponseHandler + Unpin>(
request_info: RequestInfo<'_>,
authorities: &[Arc<dyn AuthorityObject>],
request: &Request,
Expand Down
2 changes: 1 addition & 1 deletion crates/server/src/server/server_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ pub(crate) async fn handle_request<R: ResponseHandler, T: RequestHandler>(
let qflags = message.header().flags();
let qop_code = message.op_code();
let message_type = message.message_type();
let is_dnssec = message.edns().map_or(false, |edns| edns.flags().dnssec_ok);
let is_dnssec = message.edns().is_some_and(|edns| edns.flags().dnssec_ok);

let request = Request::new(message, src_addr, protocol);

Expand Down
2 changes: 1 addition & 1 deletion crates/server/src/store/in_memory/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ impl Authority for InMemoryAuthority {
.map(Record::data)
.and_then(RData::as_dnssec)
.and_then(DNSSECRData::as_nsec)
.map_or(false, |r| {
.is_some_and(|r| {
// the search name is less than the next NSEC record
*name < r.next_domain_name().into() ||
// this is the last record, and wraps to the beginning of the zone
Expand Down

0 comments on commit ac5cf90

Please sign in to comment.