diff --git a/.cargo-husky/hooks/pre-commit b/.cargo-husky/hooks/pre-commit index 449eba189..e986843cf 100755 --- a/.cargo-husky/hooks/pre-commit +++ b/.cargo-husky/hooks/pre-commit @@ -8,8 +8,8 @@ set -e echo '+cargo fmt --all -- --check' cargo fmt --all -- --check -echo '+cargo clippy --all-features -- -D warnings' -cargo clippy --all-features -- -D warnings +echo '+cargo clippy --all-features --all-targets -- -D warnings' +cargo clippy --all-features --all-targets -- -D warnings echo '+cargo test --all' cargo test --all diff --git a/.cargo-husky/hooks/pre-push b/.cargo-husky/hooks/pre-push index 449eba189..e986843cf 100755 --- a/.cargo-husky/hooks/pre-push +++ b/.cargo-husky/hooks/pre-push @@ -8,8 +8,8 @@ set -e echo '+cargo fmt --all -- --check' cargo fmt --all -- --check -echo '+cargo clippy --all-features -- -D warnings' -cargo clippy --all-features -- -D warnings +echo '+cargo clippy --all-features --all-targets -- -D warnings' +cargo clippy --all-features --all-targets -- -D warnings echo '+cargo test --all' cargo test --all diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26d373b93..b237cd071 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ rust-latest: - cargo build --verbose --target x86_64-unknown-linux-gnu - cargo test --verbose --target x86_64-unknown-linux-gnu - rustup component add clippy rustfmt - - cargo clippy --all-features --tests -- -D warnings + - cargo clippy --all-features --all-targets -- -D warnings - cargo fmt -- --check - cp cargo-audit $CARGO_HOME/bin/ || cargo install cargo-audit - ./maint/cargo_audit.sh @@ -45,7 +45,7 @@ rust-nightly: - cargo test --verbose --target x86_64-unknown-linux-gnu --all-features - rustup component add clippy # We check these extra warnings on CI only, since we don't want to forbid them while developing. - - cargo clippy --all-features -- -D clippy::dbg_macro -D clippy::print_stdout -D clippy::print_stderr + - cargo clippy --all-features --tests -- -D clippy::dbg_macro -D clippy::print_stdout -D clippy::print_stderr - RUSTDOCFLAGS="-Dwarnings" cargo doc --all-features --document-private-items tags: - amd64 diff --git a/crates/tor-llcrypto/tests/testvec.rs b/crates/tor-llcrypto/tests/testvec.rs index 1cccadc04..dcb832e11 100644 --- a/crates/tor-llcrypto/tests/testvec.rs +++ b/crates/tor-llcrypto/tests/testvec.rs @@ -567,7 +567,7 @@ rI2rzhqqBIhzFFaYuxyRAhkSBxCKTdl6X0k74ahT3MM= "; assert!(public.verify(&digest, &to_der(sig)).is_ok()); - assert!(!public.verify(&wrong_digest, &to_der(sig)).is_ok()); + assert!(public.verify(&wrong_digest, &to_der(sig)).is_err()); let val = rsa::ValidatableRsaSignature::new(&public, &to_der(sig), &digest); diff --git a/crates/tor-units/src/lib.rs b/crates/tor-units/src/lib.rs index 6acb80ad4..370954b1a 100644 --- a/crates/tor-units/src/lib.rs +++ b/crates/tor-units/src/lib.rs @@ -530,13 +530,11 @@ mod tests { #[test] fn bounded_from_i32() { - let mut x: Result, Error>; - - x = (50).try_into(); + let x: Result, _> = 50.try_into(); let y: i32 = x.unwrap().into(); assert_eq!(y, 50); - x = (1000).try_into(); + let x: Result, _> = 1000.try_into(); assert!(x.is_err()); }