Skip to content

Commit

Permalink
chore: fix clippy::borrow_deref_ref lints (#2277)
Browse files Browse the repository at this point in the history
This fixes new Clippy lints introduced in the latest Rust version.

* chore: fix `clippy::borrow_deref_ref` lints
* chore: fix `clippy::partial_eq_without_eq` lint
  • Loading branch information
hawkw committed Aug 15, 2022
1 parent 9a8e7e6 commit f63ae9b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/examples/futures-proxy-server.rs
Expand Up @@ -86,7 +86,7 @@ pub struct Args {
server_addr: SocketAddr,
}

#[derive(PartialEq, Debug)]
#[derive(Eq, PartialEq, Debug)]
pub enum LogFormat {
Plain,
Json,
Expand Down
2 changes: 1 addition & 1 deletion tracing-attributes/src/expand.rs
Expand Up @@ -411,7 +411,7 @@ impl RecordType {
RecordType::Value
}
syn::Type::Reference(syn::TypeReference { elem, .. }) => {
RecordType::parse_from_ty(&*elem)
RecordType::parse_from_ty(elem)
}
_ => RecordType::Debug,
}
Expand Down
4 changes: 2 additions & 2 deletions tracing-core/src/dispatch.rs
Expand Up @@ -804,7 +804,7 @@ impl Dispatch {
/// `T`.
#[inline]
pub fn is<T: Any>(&self) -> bool {
<dyn Collect>::is::<T>(&*self.collector())
<dyn Collect>::is::<T>(self.collector())
}

/// Returns some reference to the [`Collect`] this `Dispatch` forwards to
Expand All @@ -813,7 +813,7 @@ impl Dispatch {
/// [`Collect`]: super::collect::Collect
#[inline]
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
<dyn Collect>::downcast_ref(&*self.collector())
<dyn Collect>::downcast_ref(self.collector())
}
}

Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/error.rs
Expand Up @@ -209,7 +209,7 @@ impl ErrorImpl<Erased> {
// uphold this is UB. since the `From` impl is parameterized over the original error type,
// the function pointer we construct here will also retain the original type. therefore,
// when this is consumed by the `error` method, it will be safe to call.
unsafe { &*(self.vtable.object_ref)(self) }
unsafe { (self.vtable.object_ref)(self) }
}
}

Expand Down

0 comments on commit f63ae9b

Please sign in to comment.