diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index b4a7cbad..5fb3c60b 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -38,6 +38,7 @@ jobs: - name: Run rust-clippy run: cargo clippy + --all-targets --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt continue-on-error: true diff --git a/tests/aggregator_client.rs b/tests/aggregator_client.rs index a73b5cab..6ba5f1e7 100644 --- a/tests/aggregator_client.rs +++ b/tests/aggregator_client.rs @@ -24,13 +24,10 @@ async fn get_task_ids(app: DivviupApi, client_logs: ClientLogs) -> TestResult { log.request_headers .get_str(KnownHeaderName::Authorization) .unwrap() - == &format!("Bearer {}", aggregator.bearer_token(app.crypter()).unwrap()) + == format!("Bearer {}", aggregator.bearer_token(app.crypter()).unwrap()) })); - let queries = logs - .iter() - .map(|log| log.url.query().clone()) - .collect::>(); + let queries = logs.iter().map(|log| log.url.query()).collect::>(); assert_eq!( &queries, &[ diff --git a/tests/crypter.rs b/tests/crypter.rs index 674f5bdb..85ffc171 100644 --- a/tests/crypter.rs +++ b/tests/crypter.rs @@ -15,7 +15,7 @@ fn round_trip_with_current_key() { #[test] fn round_trip_with_old_key() { let old_key = Crypter::generate_key(); - let crypter = Crypter::from(old_key.clone()); + let crypter = Crypter::from(old_key); let encrypted = crypter.encrypt(AAD, PLAINTEXT).unwrap(); let crypter = Crypter::new(Crypter::generate_key(), [old_key]); @@ -49,12 +49,10 @@ fn parsing() { let keys = std::iter::repeat_with(Crypter::generate_key) .take(5) .collect::>(); - let encrypted = Crypter::from(keys[0].clone()) - .encrypt(AAD, PLAINTEXT) - .unwrap(); + let encrypted = Crypter::from(keys[0]).encrypt(AAD, PLAINTEXT).unwrap(); let crypter = keys .iter() - .map(|k| URL_SAFE_NO_PAD.encode(&k)) + .map(|k| URL_SAFE_NO_PAD.encode(k)) .collect::>() .join(",") .parse::()