Skip to content

Commit

Permalink
Merge pull request #37 from magnusuMET/clippy
Browse files Browse the repository at this point in the history
Fix clippy lints
  • Loading branch information
magnusuMET authored Nov 29, 2024
2 parents 4ed9f13 + 2046376 commit 6d91ec4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hdf5-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion hdf5-types/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<T: Copy> Deref for VarLenArray<T> {
}
}

impl<'a, T: Copy> From<&'a [T]> for VarLenArray<T> {
impl<T: Copy> From<&[T]> for VarLenArray<T> {
#[inline]
fn from(arr: &[T]) -> Self {
Self::from_slice(arr)
Expand Down
1 change: 1 addition & 0 deletions hdf5-types/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ impl<const N: usize> FromStr for FixedUnicode<N> {
type Err = StringError;

fn from_str(s: &str) -> Result<Self, <Self as FromStr>::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 {
Expand Down

0 comments on commit 6d91ec4

Please sign in to comment.