From 6a9e8faad2f724be1ddf6cff8c312f3c205193b0 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sat, 2 Mar 2024 22:19:56 -0500 Subject: [PATCH] Enable `clippy::unnecessary_operation` (#8752) This PR enables the [`clippy::unnecessary_operation`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_operation) rule and fixes the outstanding violations. Release Notes: - N/A --- crates/collab/src/db/tests/contributor_tests.rs | 3 +-- crates/collab/src/db/tests/db_tests.rs | 3 +-- tooling/xtask/src/main.rs | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/collab/src/db/tests/contributor_tests.rs b/crates/collab/src/db/tests/contributor_tests.rs index c826f0083a..f3a9dfbd40 100644 --- a/crates/collab/src/db/tests/contributor_tests.rs +++ b/crates/collab/src/db/tests/contributor_tests.rs @@ -18,8 +18,7 @@ async fn test_contributors(db: &Arc) { }, ) .await - .unwrap() - .user_id; + .unwrap(); assert_eq!(db.get_contributors().await.unwrap(), Vec::::new()); diff --git a/crates/collab/src/db/tests/db_tests.rs b/crates/collab/src/db/tests/db_tests.rs index 3149c8a8b6..54ce3f6f41 100644 --- a/crates/collab/src/db/tests/db_tests.rs +++ b/crates/collab/src/db/tests/db_tests.rs @@ -87,8 +87,7 @@ async fn test_get_or_create_user_by_github_account(db: &Arc) { }, ) .await - .unwrap() - .user_id; + .unwrap(); let user_id2 = db .create_user( "user2@example.com", diff --git a/tooling/xtask/src/main.rs b/tooling/xtask/src/main.rs index 955baffd67..836e8826c4 100644 --- a/tooling/xtask/src/main.rs +++ b/tooling/xtask/src/main.rs @@ -114,7 +114,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> { "clippy::single_range_in_vec_init", "clippy::suspicious_to_owned", "clippy::type_complexity", - "clippy::unnecessary_operation", "clippy::unnecessary_to_owned", "clippy::unnecessary_unwrap", "clippy::useless_conversion",