fix clippy warnings for rustc 1.50
This commit is contained in:
@@ -201,6 +201,7 @@ fn load_zone(
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "dnssec"))]
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn load_keys(
|
||||
_authority: &mut dyn AuthorityObject,
|
||||
_zone_name: Name,
|
||||
|
@@ -373,6 +373,7 @@ fn into_pkey(parsed: RSAPublicKey<'_>) -> ProtoResult<PKey<Public>> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "ring")]
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn into_pkey(parsed: RSAPublicKey<'_>) -> ProtoResult<RSAPublicKey<'_>> {
|
||||
Ok(parsed)
|
||||
}
|
||||
|
@@ -869,12 +869,14 @@ impl Name {
|
||||
}
|
||||
|
||||
trait LabelEnc {
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
fn to_label(name: &str) -> ProtoResult<Label>;
|
||||
fn write_label<W: Write>(f: &mut W, label: &Label) -> Result<(), fmt::Error>;
|
||||
}
|
||||
|
||||
struct LabelEncAscii;
|
||||
impl LabelEnc for LabelEncAscii {
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
fn to_label(name: &str) -> ProtoResult<Label> {
|
||||
Label::from_ascii(name)
|
||||
}
|
||||
@@ -886,6 +888,7 @@ impl LabelEnc for LabelEncAscii {
|
||||
|
||||
struct LabelEncUtf8;
|
||||
impl LabelEnc for LabelEncUtf8 {
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
fn to_label(name: &str) -> ProtoResult<Label> {
|
||||
Label::from_utf8(name)
|
||||
}
|
||||
|
@@ -197,6 +197,7 @@ impl<C: DnsHandle<Error = ResolveError>, P: ConnectionProvider<Conn = C>> AsyncR
|
||||
/// background task that runs resolutions for the `AsyncResolver`. See the
|
||||
/// documentation for `AsyncResolver` for more information on how to use
|
||||
/// the background future.
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
pub(crate) fn new_with_conn(
|
||||
config: ResolverConfig,
|
||||
options: ResolverOpts,
|
||||
|
@@ -387,6 +387,7 @@ where
|
||||
// restrict to the RData type requested
|
||||
if query.query_class() == r.dns_class() {
|
||||
// standard evaluation, it's an any type or it's the requested type and the search_name matches
|
||||
#[allow(clippy::suspicious_operation_groupings)]
|
||||
if (query.query_type().is_any() || query.query_type() == r.rr_type())
|
||||
&& (search_name.as_ref() == r.name() || query.name() == r.name())
|
||||
{
|
||||
@@ -462,6 +463,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn cname(&self, lookup: Lookup, query: Query, cname_ttl: u32) -> Result<Lookup, ResolveError> {
|
||||
// this duplicates the cache entry under the original query
|
||||
Ok(self.lru.duplicate(query, lookup, cname_ttl, Instant::now()))
|
||||
|
@@ -219,7 +219,7 @@ impl Stream for NeverReturnsClientStream {
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
// poll the timer forever...
|
||||
if let Poll::Pending = self.timeout.poll_unpin(cx) {
|
||||
if self.timeout.poll_unpin(cx).is_pending() {
|
||||
return Poll::Pending;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user