diff --git a/.gitignore b/.gitignore index a9d37c5..6936990 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -target +/target +**/*.rs.bk Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 47c07b9..250c308 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,9 +22,8 @@ simd_asm = ["simd_opt"] std = [] [dependencies] -arrayvec = {version = "0.4.6", default-features = false} +arrayvec = { version = "0.4.0", default-features = false } constant_time_eq = "0.1.0" -clippy = {version = "0.0.41", optional = true} [dev-dependencies] data-encoding = "2.0.0" diff --git a/src/blake2.rs b/src/blake2.rs index 4fa602d..d244dc2 100644 --- a/src/blake2.rs +++ b/src/blake2.rs @@ -44,7 +44,7 @@ macro_rules! blake2_impl { nn: usize, } - #[cfg_attr(feature = "clippy", allow(len_without_is_empty))] + #[cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty))] impl $result { /// Returns the contained hash result as a byte string. #[inline] @@ -107,7 +107,7 @@ macro_rules! blake2_impl { pub fn new(nn: usize) -> Self { Self::with_key(nn, &[]) } /// Creates a new hashing context with a key. - #[cfg_attr(feature = "clippy", allow(cast_possible_truncation))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] pub fn with_key(nn: usize, k: &[u8]) -> Self { let kk = k.len(); assert!(nn >= 1 && nn <= $bytes && kk <= $bytes); @@ -128,7 +128,7 @@ macro_rules! blake2_impl { } #[doc(hidden)] - #[cfg_attr(feature = "clippy", allow(cast_possible_truncation))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] pub fn with_parameter_block(p: &[$word; 8]) -> Self { let nn = p[0] as u8 as usize; let kk = (p[0] >> 8) as u8 as usize; @@ -144,7 +144,7 @@ macro_rules! blake2_impl { } /// Updates the hashing context with more data. - #[cfg_attr(feature = "clippy", allow(cast_possible_truncation))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] pub fn update(&mut self, data: &[u8]) { let mut rest = data; @@ -190,7 +190,7 @@ macro_rules! blake2_impl { self.finalize_with_flag(!0) } - #[cfg_attr(feature = "clippy", allow(cast_possible_truncation))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] fn finalize_with_flag(mut self, f1: $word) -> $result { let off = (self.t % ($bytes * 2)) as usize; if off != 0 { @@ -242,7 +242,7 @@ macro_rules! blake2_impl { $state::unshuffle(v); } - #[cfg_attr(feature = "clippy", allow(cast_possible_truncation, eq_op))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, eq_op))] fn compress(&mut self, f0: $word, f1: $word) { use $crate::blake2::SIGMA; @@ -303,7 +303,7 @@ macro_rules! blake2_impl { } } -#[cfg_attr(feature = "clippy", allow(cast_possible_truncation))] +#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))] #[cold] pub fn selftest_seq(len: usize) -> ArrayVec<[u8; 1024]> { use core::num::Wrapping; diff --git a/src/blake2b.rs b/src/blake2b.rs index 8270d42..0e93599 100644 --- a/src/blake2b.rs +++ b/src/blake2b.rs @@ -52,7 +52,7 @@ blake2_bench_impl!(Blake2b, 64); #[cfg(test)] mod tests { - #![cfg_attr(feature = "clippy", allow(result_unwrap_used))] + #![cfg_attr(feature = "cargo-clippy", allow(result_unwrap_used))] extern crate data_encoding; use self::data_encoding::HEXUPPER; diff --git a/src/blake2s.rs b/src/blake2s.rs index 6065a11..b864d35 100644 --- a/src/blake2s.rs +++ b/src/blake2s.rs @@ -50,7 +50,7 @@ blake2_bench_impl!(Blake2s, 32); #[cfg(test)] mod tests { - #![cfg_attr(feature = "clippy", allow(result_unwrap_used))] + #![cfg_attr(feature = "cargo-clippy", allow(result_unwrap_used))] extern crate data_encoding; use self::data_encoding::HEXUPPER; diff --git a/src/lib.rs b/src/lib.rs index eca7b4a..bf882ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,9 +11,7 @@ #![warn(missing_docs)] -#![cfg_attr(feature = "clippy", feature(plugin))] -#![cfg_attr(feature = "clippy", plugin(clippy))] -#![cfg_attr(feature = "clippy", warn(clippy_pedantic))] +#![cfg_attr(feature = "cargo-clippy", warn(clippy_pedantic))] #![cfg_attr(all(feature = "bench", test), feature(test))] #![cfg_attr(feature = "simd", feature(platform_intrinsics, repr_simd))] diff --git a/src/simd.rs b/src/simd.rs index 611ebbd..1ac657d 100644 --- a/src/simd.rs +++ b/src/simd.rs @@ -5,7 +5,7 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -#![cfg_attr(feature = "clippy", allow(inline_always))] +#![cfg_attr(feature = "cargo-clippy", allow(inline_always))] use simd_opt; diff --git a/src/simd_opt/mod.rs b/src/simd_opt/mod.rs index 268af0c..b632d9f 100644 --- a/src/simd_opt/mod.rs +++ b/src/simd_opt/mod.rs @@ -5,7 +5,7 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -#![cfg_attr(feature = "clippy", allow(inline_always))] +#![cfg_attr(feature = "cargo-clippy", allow(inline_always))] #[cfg(feature = "simd")] macro_rules! transmute_shuffle { diff --git a/src/simd_opt/u32x4.rs b/src/simd_opt/u32x4.rs index b6c42d0..6e3c9b2 100644 --- a/src/simd_opt/u32x4.rs +++ b/src/simd_opt/u32x4.rs @@ -5,7 +5,7 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -#![cfg_attr(feature = "clippy", allow(inline_always))] +#![cfg_attr(feature = "cargo-clippy", allow(inline_always))] use simdty::u32x4; diff --git a/src/simd_opt/u64x4.rs b/src/simd_opt/u64x4.rs index ef55585..7b64ca3 100644 --- a/src/simd_opt/u64x4.rs +++ b/src/simd_opt/u64x4.rs @@ -5,7 +5,7 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -#![cfg_attr(feature = "clippy", allow(inline_always))] +#![cfg_attr(feature = "cargo-clippy", allow(inline_always))] use simdty::u64x4; diff --git a/src/simdty.rs b/src/simdty.rs index 6a16fc8..ba058b0 100644 --- a/src/simdty.rs +++ b/src/simdty.rs @@ -64,7 +64,7 @@ pub type u16x16 = Simd16; pub type u8x32 = Simd32; -#[cfg_attr(feature = "clippy", allow(inline_always))] +#[cfg_attr(feature = "cargo-clippy", allow(inline_always))] impl Simd4 { #[inline(always)] pub fn new(e0: T, e1: T, e2: T, e3: T) -> Simd4 {