Clippy all targets (#153)

* Fix clippy lints in tests

* CI: let clippy lint also tests

They deserve equal clippy love, right? :)
pull/155/head
Matěj Laitl 2021-09-15 16:47:24 +02:00 committed by GitHub
parent 4265a1fbf1
commit 72353ed7a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -56,4 +56,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: --all-targets -- -D warnings

View File

@ -1,6 +1,8 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
// https://github.com/rust-lang/rust-bindgen/issues/1651
#![allow(deref_nullptr)]
#[cfg(target_os = "linux")]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

View File

@ -491,22 +491,22 @@ mod test {
#[test]
fn test_rng_sanity_private() {
let first = Key::generate_private();
assert!(first.as_bytes() != &[0u8; 32]);
assert!(first.as_bytes() != [0u8; 32]);
for _ in 0..100_000 {
let key = Key::generate_private();
assert!(first != key);
assert!(key.as_bytes() != &[0u8; 32]);
assert!(key.as_bytes() != [0u8; 32]);
}
}
#[test]
fn test_rng_sanity_preshared() {
let first = Key::generate_preshared();
assert!(first.as_bytes() != &[0u8; 32]);
assert!(first.as_bytes() != [0u8; 32]);
for _ in 0..100_000 {
let key = Key::generate_preshared();
assert!(first != key);
assert!(key.as_bytes() != &[0u8; 32]);
assert!(key.as_bytes() != [0u8; 32]);
}
}
}