Skip to content

Commit

Permalink
Clippy all targets (#153)
Browse files Browse the repository at this point in the history
* Fix clippy lints in tests

* CI: let clippy lint also tests

They deserve equal clippy love, right? :)
  • Loading branch information
strohel committed Sep 15, 2021
1 parent 4265a1f commit 72353ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: --all-targets -- -D warnings
2 changes: 2 additions & 0 deletions wireguard-control-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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"));
8 changes: 4 additions & 4 deletions wireguard-control/src/backends/userspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}

0 comments on commit 72353ed

Please sign in to comment.