diff --git a/netcdf/src/attribute.rs b/netcdf/src/attribute.rs index 6bdc275..0cc5c5d 100644 --- a/netcdf/src/attribute.rs +++ b/netcdf/src/attribute.rs @@ -27,7 +27,7 @@ pub struct Attribute<'a> { pub(crate) _marker: PhantomData<&'a nc_type>, } -impl<'a> std::fmt::Debug for Attribute<'a> { +impl std::fmt::Debug for Attribute<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "name: {}", self.name())?; write!(f, "ncid: {}", self.ncid)?; @@ -35,7 +35,7 @@ impl<'a> std::fmt::Debug for Attribute<'a> { } } -impl<'a> Attribute<'a> { +impl Attribute<'_> { /// Get the name of the attribute /// /// # Panics @@ -398,7 +398,7 @@ pub(crate) struct AttributeIterator<'a> { _marker: PhantomData<&'a nc_type>, } -impl<'a> AttributeIterator<'a> { +impl AttributeIterator<'_> { pub(crate) fn new(ncid: nc_type, varid: Option) -> error::Result { let mut natts = 0; checked_with_lock(|| unsafe { @@ -474,7 +474,7 @@ pub enum AttributeValue { Strs(Vec), } -impl<'a> Attribute<'a> { +impl Attribute<'_> { #[allow(clippy::needless_pass_by_value)] // All values will be small #[allow(clippy::too_many_lines)] pub(crate) fn put( diff --git a/netcdf/src/dimension.rs b/netcdf/src/dimension.rs index 2b706ed..2d0ff2f 100644 --- a/netcdf/src/dimension.rs +++ b/netcdf/src/dimension.rs @@ -27,7 +27,7 @@ pub struct DimensionIdentifier { } #[allow(clippy::len_without_is_empty)] -impl<'g> Dimension<'g> { +impl Dimension<'_> { /// Get current length of this dimension pub fn len(&self) -> usize { if let Some(x) = self.len { diff --git a/netcdf/src/extent.rs b/netcdf/src/extent.rs index 05100c6..3029fa2 100644 --- a/netcdf/src/extent.rs +++ b/netcdf/src/extent.rs @@ -478,7 +478,7 @@ enum StartCountStrideIter<'a> { Extent(std::iter::Zip, std::slice::Iter<'a, Dimension<'a>>>), } -impl<'a> Iterator for StartCountStrideIter<'a> { +impl Iterator for StartCountStrideIter<'_> { type Item = StartCountStrideIterItem; fn next(&mut self) -> Option { match self { diff --git a/netcdf/src/file.rs b/netcdf/src/file.rs index caf24d7..75715e9 100644 --- a/netcdf/src/file.rs +++ b/netcdf/src/file.rs @@ -518,7 +518,7 @@ impl FileMut { pub struct FileMem<'buffer>(File, std::marker::PhantomData<&'buffer [u8]>); #[cfg(feature = "has-mmap")] -impl<'a> std::ops::Deref for FileMem<'a> { +impl std::ops::Deref for FileMem<'_> { type Target = File; fn deref(&self) -> &Self::Target { &self.0 diff --git a/netcdf/src/group.rs b/netcdf/src/group.rs index 820cbe3..959c194 100644 --- a/netcdf/src/group.rs +++ b/netcdf/src/group.rs @@ -177,8 +177,6 @@ impl<'f> GroupMut<'f> { crate::types::add_type(self.ncid, typ, false) } - /// Add an opaque datatype, with `size` bytes - /// Add an attribute to the group pub fn add_attribute<'a, T>(&'a mut self, name: &str, val: T) -> error::Result> where diff --git a/netcdf/src/variable.rs b/netcdf/src/variable.rs index c87e83e..f0c1348 100644 --- a/netcdf/src/variable.rs +++ b/netcdf/src/variable.rs @@ -229,7 +229,7 @@ impl<'g> Variable<'g> { } } } -impl<'g> VariableMut<'g> { +impl VariableMut<'_> { /// Sets compression on the variable. Must be set before filling in data. /// /// `deflate_level` can take a value 0..=9, with 0 being no @@ -289,7 +289,7 @@ impl<'g> VariableMut<'g> { } } -impl<'g> VariableMut<'g> { +impl VariableMut<'_> { /// Adds an attribute to the variable pub fn put_attribute(&mut self, name: &str, val: T) -> error::Result where @@ -299,7 +299,7 @@ impl<'g> VariableMut<'g> { } } -impl<'g> Variable<'g> { +impl Variable<'_> { fn get_values_mono(&self, extents: &Extents) -> error::Result> { let dims = self.dimensions(); let (start, count, stride) = extents.get_start_count_stride(dims)?; @@ -597,7 +597,7 @@ impl<'g> Variable<'g> { } } -impl<'g> VariableMut<'g> { +impl VariableMut<'_> { fn put_values_mono( &mut self, values: &[T], @@ -804,7 +804,7 @@ impl<'g> VariableMut<'g> { } } -impl<'g> VariableMut<'g> { +impl VariableMut<'_> { pub(crate) fn add_from_str( ncid: nc_type, xtype: &NcVariableType,