Skip to content

Commit

Permalink
chore: fix some clippy 1.83 warnings (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel authored Nov 30, 2024
1 parent 51ce498 commit af6eb78
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/domain/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ pub struct Category<'a> {
domain: &'a Domain,
}

impl<'a> PartialEq for Category<'a> {
impl PartialEq for Category<'_> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id && std::ptr::eq(self.domain, other.domain)
}
}

impl<'a> Eq for Category<'a> {}
impl Eq for Category<'_> {}

impl<'a> Category<'a> {
pub(super) fn new(id: u32, domain: &'a Domain) -> Category<'a> {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/event_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct EventAttributes<'a> {
pub(super) message: Option<Message<'a>>,
}

impl<'a> EventAttributes<'a> {
impl EventAttributes<'_> {
pub(super) fn encode(&self) -> nvtx_sys::EventAttributes {
let (color_type, color_value) = self
.color
Expand Down
2 changes: 1 addition & 1 deletion src/domain/local_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<'a> LocalRange<'a> {
}
}

impl<'a> Drop for LocalRange<'a> {
impl Drop for LocalRange<'_> {
fn drop(&mut self) {
nvtx_sys::domain_range_pop(self.domain.handle);
}
Expand Down
4 changes: 2 additions & 2 deletions src/domain/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<'a> From<RegisteredString<'a>> for Message<'a> {
}
}

impl<'a, T: Into<Str>> From<T> for Message<'a> {
impl<T: Into<Str>> From<T> for Message<'_> {
fn from(value: T) -> Self {
match value.into() {
Str::Ascii(s) => Message::Ascii(s),
Expand All @@ -33,7 +33,7 @@ impl<'a, T: Into<Str>> From<T> for Message<'a> {
}
}

impl<'a> TypeValueEncodable for Message<'a> {
impl TypeValueEncodable for Message<'_> {
type Type = nvtx_sys::MessageType;
type Value = nvtx_sys::MessageValue;

Expand Down
2 changes: 1 addition & 1 deletion src/domain/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl<'a> Range<'a> {
}
}

impl<'a> Drop for Range<'a> {
impl Drop for Range<'_> {
fn drop(&mut self) {
self.domain.range_end(self.id);
}
Expand Down
4 changes: 2 additions & 2 deletions src/domain/registered_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ pub struct RegisteredString<'a> {
domain: &'a Domain,
}

impl<'a> PartialEq for RegisteredString<'a> {
impl PartialEq for RegisteredString<'_> {
fn eq(&self, other: &Self) -> bool {
self.handle == other.handle
&& self.uid == other.uid
&& std::ptr::eq(self.domain, other.domain)
}
}

impl<'a> Eq for RegisteredString<'a> {}
impl Eq for RegisteredString<'_> {}

impl<'a> RegisteredString<'a> {
pub(super) fn new(
Expand Down
2 changes: 1 addition & 1 deletion src/domain/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Resource<'a> {
pub(super) _lifetime: PhantomData<&'a ()>,
}

impl<'a> Drop for Resource<'a> {
impl Drop for Resource<'_> {
fn drop(&mut self) {
nvtx_sys::domain_resource_destroy(self.handle)
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a> UserSync<'a> {
}
}

impl<'a> Drop for UserSync<'a> {
impl Drop for UserSync<'_> {
fn drop(&mut self) {
nvtx_sys::domain_syncuser_destroy(self.handle)
}
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ where
}
}

impl<'a, S> Visit for NvtxVisitor<'a, S>
impl<S> Visit for NvtxVisitor<'_, S>
where
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
{
Expand Down

0 comments on commit af6eb78

Please sign in to comment.