diff --git a/fastrace/Cargo.toml b/fastrace/Cargo.toml index 6e17685b..ecfb74a4 100644 --- a/fastrace/Cargo.toml +++ b/fastrace/Cargo.toml @@ -75,3 +75,7 @@ name = "spsc" [[bench]] harness = false name = "object_pool" + +[lints.clippy] +# https://github.com/rust-lang/rust-clippy/issues/13458 +needless_return = "allow" diff --git a/fastrace/src/util/object_pool.rs b/fastrace/src/util/object_pool.rs index 7ac67dd2..b0a0650a 100644 --- a/fastrace/src/util/object_pool.rs +++ b/fastrace/src/util/object_pool.rs @@ -109,7 +109,7 @@ impl<'a, T> Reusable<'a, T> { } } -impl<'a, T> std::fmt::Debug for Reusable<'a, T> +impl std::fmt::Debug for Reusable<'_, T> where T: std::fmt::Debug { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -117,7 +117,7 @@ where T: std::fmt::Debug } } -impl<'a, T> std::cmp::PartialEq for Reusable<'a, T> +impl std::cmp::PartialEq for Reusable<'_, T> where T: std::cmp::PartialEq { fn eq(&self, other: &Self) -> bool { @@ -125,9 +125,9 @@ where T: std::cmp::PartialEq } } -impl<'a, T> std::cmp::Eq for Reusable<'a, T> where T: std::cmp::Eq {} +impl std::cmp::Eq for Reusable<'_, T> where T: std::cmp::Eq {} -impl<'a, T> Deref for Reusable<'a, T> { +impl Deref for Reusable<'_, T> { type Target = T; #[inline] @@ -136,14 +136,14 @@ impl<'a, T> Deref for Reusable<'a, T> { } } -impl<'a, T> DerefMut for Reusable<'a, T> { +impl 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 Drop for Reusable<'_, T> { #[inline] fn drop(&mut self) { unsafe {