Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fastrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ opentelemetry-otlp = { version = "0.25", features = ["trace"] }
opentelemetry_sdk = { version = "0.25", features = ["trace"] }
rand = "0.8"
rustracing = "0.6"
# FIXME: Remove `rustversion` dep after the issue is fixed. https://github.com/rust-lang/rust-clippy/issues/13458
rustversion = "1"
serial_test = "3.1"
test-harness = "0.3"
tokio = { version = "1.38", features = [
Expand Down
2 changes: 2 additions & 0 deletions fastrace/examples/asynchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ async fn other_job() {
}
}

// FIXME: Remove `expect` after the issue is fixed. https://github.com/rust-lang/rust-clippy/issues/13458
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please allow the lint in fastrace/Cargo.toml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

#[rustversion::attr(nightly, expect(clippy::needless_return))]
#[tokio::main]
async fn main() {
fastrace::set_reporter(ReportAll::new(), Config::default());
Expand Down
2 changes: 2 additions & 0 deletions fastrace/examples/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ fn func2(i: u64) {
std::thread::sleep(Duration::from_millis(i));
}

// FIXME: Remove `expect` after the issue is fixed. https://github.com/rust-lang/rust-clippy/issues/13458
#[rustversion::attr(nightly, expect(clippy::needless_return))]
#[tokio::main]
async fn main() {
fastrace::set_reporter(ReportAll::new(), Config::default());
Expand Down
12 changes: 6 additions & 6 deletions fastrace/src/util/object_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,25 @@ impl<'a, T> Reusable<'a, T> {
}
}

impl<'a, T> std::fmt::Debug for Reusable<'a, T>
impl<T> std::fmt::Debug for Reusable<'_, T>
where T: std::fmt::Debug
{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.obj.fmt(f)
}
}

impl<'a, T> std::cmp::PartialEq for Reusable<'a, T>
impl<T> std::cmp::PartialEq for Reusable<'_, T>
where T: std::cmp::PartialEq
{
fn eq(&self, other: &Self) -> bool {
T::eq(self, other)
}
}

impl<'a, T> std::cmp::Eq for Reusable<'a, T> where T: std::cmp::Eq {}
impl<T> std::cmp::Eq for Reusable<'_, T> where T: std::cmp::Eq {}

impl<'a, T> Deref for Reusable<'a, T> {
impl<T> Deref for Reusable<'_, T> {
type Target = T;

#[inline]
Expand All @@ -136,14 +136,14 @@ impl<'a, T> Deref for Reusable<'a, T> {
}
}

impl<'a, T> DerefMut for Reusable<'a, T> {
impl<T> DerefMut for Reusable<'_, T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.obj
}
}

impl<'a, T> Drop for Reusable<'a, T> {
impl<T> Drop for Reusable<'_, T> {
#[inline]
fn drop(&mut self) {
unsafe {
Expand Down