diff --git a/hdf5-derive/src/lib.rs b/hdf5-derive/src/lib.rs index 830e5196..41592f7e 100644 --- a/hdf5-derive/src/lib.rs +++ b/hdf5-derive/src/lib.rs @@ -108,7 +108,7 @@ fn impl_enum(names: &[String], values: &[Expr], repr: &Ident) -> TokenStream { fn is_phantom_data(ty: &Type) -> bool { match *ty { Type::Path(TypePath { qself: None, ref path }) => { - path.segments.iter().last().map_or(false, |x| x.ident == "PhantomData") + path.segments.iter().last().is_some_and(|x| x.ident == "PhantomData") } _ => false, } diff --git a/hdf5-types/src/array.rs b/hdf5-types/src/array.rs index cf090924..c6438e2b 100644 --- a/hdf5-types/src/array.rs +++ b/hdf5-types/src/array.rs @@ -84,7 +84,7 @@ impl Deref for VarLenArray { } } -impl<'a, T: Copy> From<&'a [T]> for VarLenArray { +impl From<&[T]> for VarLenArray { #[inline] fn from(arr: &[T]) -> Self { Self::from_slice(arr) diff --git a/hdf5-types/src/string.rs b/hdf5-types/src/string.rs index 612f462c..3f17ae46 100644 --- a/hdf5-types/src/string.rs +++ b/hdf5-types/src/string.rs @@ -547,6 +547,7 @@ impl FromStr for FixedUnicode { type Err = StringError; fn from_str(s: &str) -> Result::Err> { + // #[allow(clippy::needless_as_bytes)] // strlen vs. number of bytes if s.as_bytes().len() <= N { unsafe { Ok(Self::from_bytes(s.as_bytes())) } } else {