mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
{curve,ed}25519-dalek: clippy fixes (#710)
Clippy 1.81 brings new lints, this fixes those warnings
This commit is contained in:
parent
d5ef57a3c2
commit
cbf794d883
6 changed files with 33 additions and 25 deletions
|
|
@ -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`.
|
||||||
|
|
|
||||||
|
|
@ -774,7 +774,7 @@ impl<'d> Deserialize<'d> for SigningKey {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
SigningKey::try_from(bytes).map_err(serde::de::Error::custom)
|
Ok(SigningKey::from(bytes))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue