Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy::needless_lifetimes lints #717

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion core-foundation/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
16 changes: 8 additions & 8 deletions core-foundation/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,21 @@ 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 {
&self.0
}
}

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)
}
Expand All @@ -276,27 +276,27 @@ 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 {
&self.0
}
}

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)
}
Expand Down Expand Up @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions core-foundation/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions core-graphics/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions core-graphics/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 }
Expand Down
Loading