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 authored and davidbarsky committed Sep 8, 2022
1 parent 5a141ea commit 112dd9b
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/dispatcher.rs
Expand Up @@ -631,14 +631,14 @@ impl Dispatch {
/// `T`.
#[inline]
pub fn is<T: Any>(&self) -> bool {
<dyn Subscriber>::is::<T>(&*self.subscriber)
<dyn Subscriber>::is::<T>(&self.subscriber)
}

/// Returns some reference to the `Subscriber` this `Dispatch` forwards to
/// if it is of type `T`, or `None` if it isn't.
#[inline]
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
<dyn Subscriber>::downcast_ref(&*self.subscriber)
<dyn Subscriber>::downcast_ref(&self.subscriber)
}
}

Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/error.rs
Expand Up @@ -109,7 +109,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 112dd9b

Please sign in to comment.