{curve,ed}25519-dalek: clippy fixes (#710)

Clippy 1.81 brings new lints, this fixes those warnings
This commit is contained in:
Arthur Gautier 2024-09-30 14:09:28 -07:00 committed by GitHub
parent d5ef57a3c2
commit cbf794d883
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 33 additions and 25 deletions

View file

@ -240,7 +240,9 @@ impl u64x4 {
pub const fn new_const(x0: u64, x1: u64, x2: u64, x3: u64) -> Self { pub const fn new_const(x0: u64, x1: u64, x2: u64, x3: u64) -> Self {
// SAFETY: Transmuting between an array and a SIMD type is safe // SAFETY: Transmuting between an array and a SIMD type is safe
// https://rust-lang.github.io/unsafe-code-guidelines/layout/packed-simd-vectors.html // https://rust-lang.github.io/unsafe-code-guidelines/layout/packed-simd-vectors.html
unsafe { Self(core::mem::transmute([x0, x1, x2, x3])) } unsafe {
Self(core::mem::transmute::<[u64; 4], core::arch::x86_64::__m256i>([x0, x1, x2, x3]))
}
} }
/// A constified variant of `splat`. /// A constified variant of `splat`.
@ -290,7 +292,13 @@ impl u32x8 {
) -> Self { ) -> Self {
// SAFETY: Transmuting between an array and a SIMD type is safe // SAFETY: Transmuting between an array and a SIMD type is safe
// https://rust-lang.github.io/unsafe-code-guidelines/layout/packed-simd-vectors.html // https://rust-lang.github.io/unsafe-code-guidelines/layout/packed-simd-vectors.html
unsafe { Self(core::mem::transmute([x0, x1, x2, x3, x4, x5, x6, x7])) } unsafe {
Self(
core::mem::transmute::<[u32; 8], core::arch::x86_64::__m256i>([
x0, x1, x2, x3, x4, x5, x6, x7,
]),
)
}
} }
/// A constified variant of `splat`. /// A constified variant of `splat`.

View file

@ -774,7 +774,7 @@ impl<'d> Deserialize<'d> for SigningKey {
)); ));
} }
SigningKey::try_from(bytes).map_err(serde::de::Error::custom) Ok(SigningKey::from(bytes))
} }
} }