diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7ad6e3..3a9c9e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: matrix: rust: - stable - - 1.65.0 + - 1.73.0 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -35,7 +35,7 @@ jobs: # matrix: # rust: # - stable -# - 1.65.0 +# - 1.73.0 # steps: # - uses: actions/checkout@v2 # - uses: actions-rs/toolchain@v1 @@ -74,7 +74,7 @@ jobs: matrix: rust: - stable - - 1.65.0 + - 1.73.0 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 diff --git a/src/buffer.rs b/src/buffer.rs index 767adb8..cb37b45 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -51,7 +51,7 @@ use std::{ collections::HashMap, marker::PhantomData, - mem, + mem::size_of, os::raw::{c_int, c_longlong}, }; @@ -356,14 +356,14 @@ pub struct Iter<'a, T: 'a> { step: isize, } -impl<'a, T> Iter<'a, T> { +impl Iter<'_, T> { /// Create an iterator to move channel data out of a buffer. pub fn new(buf: &Buffer, chan: &Channel) -> Self { unsafe { let begin = ffi::iio_buffer_first(buf.buf, chan.chan).cast(); let end = ffi::iio_buffer_end(buf.buf).cast(); let ptr = begin; - let step: isize = ffi::iio_buffer_step(buf.buf) / mem::size_of::() as isize; + let step: isize = ffi::iio_buffer_step(buf.buf) / size_of::() as isize; Self { _phantom: PhantomData, @@ -412,7 +412,7 @@ impl<'a, T: 'a> IterMut<'a, T> { let begin = ffi::iio_buffer_first(buf.buf, chan.chan).cast(); let end = ffi::iio_buffer_end(buf.buf).cast(); let ptr = begin; - let step: isize = ffi::iio_buffer_step(buf.buf) / mem::size_of::() as isize; + let step: isize = ffi::iio_buffer_step(buf.buf) / size_of::() as isize; Self { _phantom: PhantomData, @@ -451,7 +451,7 @@ pub struct AttrIterator<'a> { idx: usize, } -impl<'a> Iterator for AttrIterator<'a> { +impl Iterator for AttrIterator<'_> { type Item = String; /// Gets the next Buffer attribute from the iterator diff --git a/src/channel.rs b/src/channel.rs index f9bde3d..04d7452 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -16,7 +16,7 @@ use std::{ any::TypeId, collections::HashMap, ffi::CString, - mem, + mem::{self, size_of, size_of_val}, os::raw::{c_char, c_int, c_longlong, c_uint, c_void}, }; @@ -493,7 +493,7 @@ impl Channel { } let n = buf.capacity(); - let sz_item = mem::size_of::(); + let sz_item = size_of::(); let sz_in = n * sz_item; let mut v = vec![T::default(); n]; @@ -519,7 +519,7 @@ impl Channel { } let n = buf.capacity(); - let sz_item = mem::size_of::(); + let sz_item = size_of::(); let sz_in = n * sz_item; let mut v = vec![T::default(); n]; @@ -546,8 +546,8 @@ impl Channel { return Err(Error::WrongDataType); } - let sz_item = mem::size_of::(); - let sz_in = mem::size_of_val(data); + let sz_item = size_of::(); + let sz_in = size_of_val(data); let sz = unsafe { ffi::iio_channel_write(self.chan, buf.buf, data.as_ptr().cast(), sz_in) }; @@ -564,8 +564,8 @@ impl Channel { return Err(Error::WrongDataType); } - let sz_item = mem::size_of::(); - let sz_in = mem::size_of_val(data); + let sz_item = size_of::(); + let sz_in = size_of_val(data); let sz = unsafe { ffi::iio_channel_write(self.chan, buf.buf, data.as_ptr().cast(), sz_in) }; @@ -590,7 +590,7 @@ pub struct AttrIterator<'a> { idx: usize, } -impl<'a> Iterator for AttrIterator<'a> { +impl Iterator for AttrIterator<'_> { type Item = String; /// Gets the next Channel attribute from the iterator diff --git a/src/context.rs b/src/context.rs index 42b53f5..4fb39ae 100644 --- a/src/context.rs +++ b/src/context.rs @@ -465,7 +465,7 @@ pub struct DeviceIterator<'a> { idx: usize, } -impl<'a> Iterator for DeviceIterator<'a> { +impl Iterator for DeviceIterator<'_> { type Item = Device; /// Gets the next Device from the iterator. @@ -489,7 +489,7 @@ pub struct AttrIterator<'a> { idx: usize, } -impl<'a> Iterator for AttrIterator<'a> { +impl Iterator for AttrIterator<'_> { type Item = (String, String); /// Gets the next Device attribute from the iterator. diff --git a/src/device.rs b/src/device.rs index 96f628a..15c01ed 100644 --- a/src/device.rs +++ b/src/device.rs @@ -360,7 +360,7 @@ pub struct ChannelIterator<'a> { idx: usize, } -impl<'a> Iterator for ChannelIterator<'a> { +impl Iterator for ChannelIterator<'_> { type Item = Channel; fn next(&mut self) -> Option { @@ -383,7 +383,7 @@ pub struct AttrIterator<'a> { idx: usize, } -impl<'a> Iterator for AttrIterator<'a> { +impl Iterator for AttrIterator<'_> { type Item = String; /// Gets the next Device attribute from the iterator diff --git a/src/scan_context.rs b/src/scan_context.rs index 0637ed8..13e5813 100644 --- a/src/scan_context.rs +++ b/src/scan_context.rs @@ -83,7 +83,7 @@ pub struct ScanContextIterator<'a> { idx: u32, } -impl<'a> Iterator for ScanContextIterator<'a> { +impl Iterator for ScanContextIterator<'_> { type Item = (String, String); fn next(&mut self) -> Option {