Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy lints #37

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading