Skip to content

Commit

Permalink
Fix new clippy lint about elidable lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Oct 17, 2024
1 parent 55ea2bd commit cec254a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ pub struct Device<'c> {
addr: AmsAddr,
}

impl<'c> Device<'c> {
impl Device<'_> {
/// Read the device's name + version.
pub fn get_info(&self) -> Result<DeviceInfo> {
let mut data = DeviceInfoRaw::new_zeroed();
Expand Down
6 changes: 3 additions & 3 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn listdir(device: Device, dirname: impl AsRef<[u8]>)
}
}

impl<'a> io::Write for File<'a> {
impl io::Write for File<'_> {
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
self.device.write_read(index::FILE_WRITE, self.handle, data, &mut [])
// need to convert errors back to io::Error
Expand All @@ -81,13 +81,13 @@ impl<'a> io::Write for File<'a> {
}
}

impl<'a> std::io::Read for File<'a> {
impl std::io::Read for File<'_> {
fn read(&mut self, data: &mut [u8]) -> io::Result<usize> {
self.device.write_read(index::FILE_READ, self.handle, &[], data).map_err(map_error)
}
}

impl<'a> Drop for File<'a> {
impl Drop for File<'_> {
fn drop(&mut self) {
let _ = self.device.write_read(index::FILE_CLOSE, self.handle, &[], &mut []);
}
Expand Down
2 changes: 1 addition & 1 deletion src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'c> Handle<'c> {
}
}

impl<'a> Drop for Handle<'a> {
impl Drop for Handle<'_> {
fn drop(&mut self) {
let _ = self.device.write(index::RELEASE_SYMHANDLE, 0,
&self.handle.to_le_bytes());
Expand Down

0 comments on commit cec254a

Please sign in to comment.