Fix clippy::needless_lifetimes lints (#717)

* Fix `clippy::needless_lifetimes` lints

* Fix `clippy::doc_markdown` lints
This commit is contained in:
Bruce Mitchener
2025-01-08 12:20:49 +07:00
committed by GitHub
parent 94373819a7
commit f23baea603
5 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ impl<'a, T: FromVoid> Iterator for CFArrayIterator<'a, T> {
}
}
impl<'a, T: FromVoid> ExactSizeIterator for CFArrayIterator<'a, T> {
impl<T: FromVoid> ExactSizeIterator for CFArrayIterator<'_, T> {
fn len(&self) -> usize {
(self.array.len() - self.index) as usize
}
+8 -8
View File
@@ -253,7 +253,7 @@ impl TCFType for CFType {
/// A reference to an element inside a container
pub struct ItemRef<'a, T: 'a>(ManuallyDrop<T>, PhantomData<&'a T>);
impl<'a, T> Deref for ItemRef<'a, T> {
impl<T> Deref for ItemRef<'_, T> {
type Target = T;
fn deref(&self) -> &T {
@@ -261,13 +261,13 @@ impl<'a, T> Deref for ItemRef<'a, T> {
}
}
impl<'a, T: fmt::Debug> fmt::Debug for ItemRef<'a, T> {
impl<T: fmt::Debug> fmt::Debug for ItemRef<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
self.0.fmt(f)
}
}
impl<'a, T: PartialEq> PartialEq for ItemRef<'a, T> {
impl<T: PartialEq> PartialEq for ItemRef<'_, T> {
fn eq(&self, other: &Self) -> bool {
self.0.eq(&other.0)
}
@@ -276,7 +276,7 @@ impl<'a, T: PartialEq> PartialEq for ItemRef<'a, T> {
/// A reference to a mutable element inside a container
pub struct ItemMutRef<'a, T: 'a>(ManuallyDrop<T>, PhantomData<&'a T>);
impl<'a, T> Deref for ItemMutRef<'a, T> {
impl<T> Deref for ItemMutRef<'_, T> {
type Target = T;
fn deref(&self) -> &T {
@@ -284,19 +284,19 @@ impl<'a, T> Deref for ItemMutRef<'a, T> {
}
}
impl<'a, T> DerefMut for ItemMutRef<'a, T> {
impl<T> DerefMut for ItemMutRef<'_, T> {
fn deref_mut(&mut self) -> &mut T {
&mut self.0
}
}
impl<'a, T: fmt::Debug> fmt::Debug for ItemMutRef<'a, T> {
impl<T: fmt::Debug> fmt::Debug for ItemMutRef<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
self.0.fmt(f)
}
}
impl<'a, T: PartialEq> PartialEq for ItemMutRef<'a, T> {
impl<T: PartialEq> PartialEq for ItemMutRef<'_, T> {
fn eq(&self, other: &Self) -> bool {
self.0.eq(&other.0)
}
@@ -371,7 +371,7 @@ unsafe impl ToVoid<*const c_void> for *const c_void {
}
}
unsafe impl<'a> ToVoid<CFType> for &'a CFType {
unsafe impl ToVoid<CFType> for &CFType {
fn to_void(&self) -> *const c_void {
self.as_concrete_TypeRef().as_void_ptr()
}
+2 -2
View File
@@ -151,7 +151,7 @@ impl CFString {
}
}
impl<'a> PartialEq<&'a str> for CFString {
impl PartialEq<&str> for CFString {
fn eq(&self, other: &&str) -> bool {
unsafe {
let temp = CFStringCreateWithBytesNoCopy(
@@ -167,7 +167,7 @@ impl<'a> PartialEq<&'a str> for CFString {
}
}
impl<'a> PartialEq<CFString> for &'a str {
impl PartialEq<CFString> for &str {
#[inline]
fn eq(&self, other: &CFString) -> bool {
other.eq(self)
+2 -2
View File
@@ -47,8 +47,8 @@ bitflags! {
///
/// These constants are the virtual keycodes defined originally in
/// Inside Mac Volume V, pg. V-191. They identify physical keys on a
/// keyboard. The struct contains the values of the ANSIKeyCode,
/// KeyCode, ISOKeyCode and JISKeyCode of the original Carbon headers.
/// keyboard. The struct contains the values of the `ANSIKeyCode`,
/// `KeyCode`, `ISOKeyCode` and `JISKeyCode` of the original Carbon headers.
///
/// Those constants with "ANSI" in the name are labeled
/// according to the key position on an ANSI-standard US keyboard.
+2 -2
View File
@@ -80,7 +80,7 @@ pub struct CGPathElementRef<'a> {
phantom: PhantomData<&'a CGPathElement>,
}
impl<'a> CGPathElementRef<'a> {
impl CGPathElementRef<'_> {
fn new<'b>(element: *const CGPathElement) -> CGPathElementRef<'b> {
CGPathElementRef {
element,
@@ -89,7 +89,7 @@ impl<'a> CGPathElementRef<'a> {
}
}
impl<'a> Deref for CGPathElementRef<'a> {
impl Deref for CGPathElementRef<'_> {
type Target = CGPathElement;
fn deref(&self) -> &CGPathElement {
unsafe { &*self.element }