Browse Source

Clean clippy warnings

pull/9/merge
Cesar Eduardo Barros 6 years ago
parent
commit
0fb584a12a
  1. 1
      clippy.toml
  2. 2
      src/blake2.rs
  3. 2
      src/blake2b.rs
  4. 2
      src/blake2s.rs
  5. 1
      src/bytes.rs
  6. 1
      src/lib.rs
  7. 5
      src/simdty.rs

1
clippy.toml

@ -0,0 +1 @@
doc-valid-idents = ["BLAKE2b", "BLAKE2s"]

2
src/blake2.rs

@ -303,7 +303,7 @@ macro_rules! blake2_impl {
} }
} }
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, unreadable_literal))]
#[cold] #[cold]
pub fn selftest_seq(len: usize) -> ArrayVec<[u8; 1024]> { pub fn selftest_seq(len: usize) -> ArrayVec<[u8; 1024]> {
use core::num::Wrapping; use core::num::Wrapping;

2
src/blake2b.rs

@ -34,6 +34,8 @@
//! a byte string (the comparison will take constant time), or converted //! a byte string (the comparison will take constant time), or converted
//! into a byte string. //! into a byte string.
#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
blake2_impl!(Blake2b, Blake2bResult, blake2b, u64, u64x4, 64, 32, 24, 16, 63, [ blake2_impl!(Blake2b, Blake2bResult, blake2b, u64, u64x4, 64, 32, 24, 16, 63, [
0x6A09E667F3BCC908, 0xBB67AE8584CAA73B, 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B,
0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1, 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1,

2
src/blake2s.rs

@ -34,6 +34,8 @@
//! a byte string (the comparison will take constant time), or converted //! a byte string (the comparison will take constant time), or converted
//! into a byte string. //! into a byte string.
#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
blake2_impl!(Blake2s, Blake2sResult, blake2s, u32, u32x4, 32, 16, 12, 8, 7, [ blake2_impl!(Blake2s, Blake2sResult, blake2s, u32, u32x4, 32, 16, 12, 8, 7, [
0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,
0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19,

1
src/bytes.rs

@ -10,6 +10,7 @@
use core::ptr; use core::ptr;
/// Operations on byte slices. /// Operations on byte slices.
#[cfg_attr(feature = "cargo-clippy", allow(stutter))]
pub trait BytesExt { pub trait BytesExt {
/// Set all bytes of this slice to the same value. /// Set all bytes of this slice to the same value.
/// ///

1
src/lib.rs

@ -12,6 +12,7 @@
#![warn(missing_docs)] #![warn(missing_docs)]
#![cfg_attr(feature = "cargo-clippy", warn(clippy_pedantic))] #![cfg_attr(feature = "cargo-clippy", warn(clippy_pedantic))]
#![cfg_attr(feature = "cargo-clippy", allow(missing_docs_in_private_items))]
#![cfg_attr(all(feature = "bench", test), feature(test))] #![cfg_attr(all(feature = "bench", test), feature(test))]
#![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))] #![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))]

5
src/simdty.rs

@ -8,6 +8,9 @@
#![allow(dead_code)] #![allow(dead_code)]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
// https://github.com/rust-lang-nursery/rust-clippy/issues/2453
#![cfg_attr(feature = "cargo-clippy", allow(empty_line_after_outer_attr))]
use as_bytes::Safe; use as_bytes::Safe;
#[cfg(feature = "simd")] #[cfg(feature = "simd")]
@ -67,7 +70,7 @@ pub type u8x32 = Simd32<u8>;
#[cfg_attr(feature = "cargo-clippy", allow(inline_always))] #[cfg_attr(feature = "cargo-clippy", allow(inline_always))]
impl<T> Simd4<T> { impl<T> Simd4<T> {
#[inline(always)] #[inline(always)]
pub fn new(e0: T, e1: T, e2: T, e3: T) -> Simd4<T> { pub fn new(e0: T, e1: T, e2: T, e3: T) -> Self {
Simd4(e0, e1, e2, e3) Simd4(e0, e1, e2, e3)
} }
} }

Loading…
Cancel
Save