Enable clippy::explicit_auto_deref (#8753)
This PR enables the [`clippy::explicit_auto_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_auto_deref) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
@@ -222,7 +222,7 @@ async fn test_channel_buffers_last_operations(db: &Database) {
|
||||
.unwrap();
|
||||
|
||||
buffers.push(
|
||||
db.transaction(|tx| async move { db.get_channel_buffer(channel, &*tx).await })
|
||||
db.transaction(|tx| async move { db.get_channel_buffer(channel, &tx).await })
|
||||
.await
|
||||
.unwrap(),
|
||||
);
|
||||
@@ -238,7 +238,7 @@ async fn test_channel_buffers_last_operations(db: &Database) {
|
||||
.transaction(|tx| {
|
||||
let buffers = &buffers;
|
||||
async move {
|
||||
db.get_latest_operations_for_buffers([buffers[0].id, buffers[2].id], &*tx)
|
||||
db.get_latest_operations_for_buffers([buffers[0].id, buffers[2].id], &tx)
|
||||
.await
|
||||
}
|
||||
})
|
||||
@@ -302,7 +302,7 @@ async fn test_channel_buffers_last_operations(db: &Database) {
|
||||
.transaction(|tx| {
|
||||
let buffers = &buffers;
|
||||
async move {
|
||||
db.get_latest_operations_for_buffers([buffers[1].id, buffers[2].id], &*tx)
|
||||
db.get_latest_operations_for_buffers([buffers[1].id, buffers[2].id], &tx)
|
||||
.await
|
||||
}
|
||||
})
|
||||
@@ -320,7 +320,7 @@ async fn test_channel_buffers_last_operations(db: &Database) {
|
||||
.transaction(|tx| {
|
||||
let buffers = &buffers;
|
||||
async move {
|
||||
db.get_latest_operations_for_buffers([buffers[0].id, buffers[1].id], &*tx)
|
||||
db.get_latest_operations_for_buffers([buffers[0].id, buffers[1].id], &tx)
|
||||
.await
|
||||
}
|
||||
})
|
||||
@@ -342,7 +342,7 @@ async fn test_channel_buffers_last_operations(db: &Database) {
|
||||
hash.insert(buffers[1].id, buffers[1].channel_id);
|
||||
hash.insert(buffers[2].id, buffers[2].channel_id);
|
||||
|
||||
async move { db.latest_channel_buffer_changes(&hash, &*tx).await }
|
||||
async move { db.latest_channel_buffer_changes(&hash, &tx).await }
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -42,8 +42,8 @@ async fn test_channels(db: &Arc<Database>) {
|
||||
|
||||
let mut members = db
|
||||
.transaction(|tx| async move {
|
||||
let channel = db.get_channel_internal(replace_id, &*tx).await?;
|
||||
Ok(db.get_channel_participants(&channel, &*tx).await?)
|
||||
let channel = db.get_channel_internal(replace_id, &tx).await?;
|
||||
Ok(db.get_channel_participants(&channel, &tx).await?)
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -464,9 +464,9 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &*tx).await?,
|
||||
&db.get_channel_internal(public_channel_id, &tx).await?,
|
||||
admin,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -474,9 +474,9 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
.unwrap();
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &*tx).await?,
|
||||
&db.get_channel_internal(public_channel_id, &tx).await?,
|
||||
member,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -517,9 +517,9 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &*tx).await?,
|
||||
&db.get_channel_internal(public_channel_id, &tx).await?,
|
||||
guest,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -547,11 +547,11 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
assert!(db
|
||||
.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &*tx)
|
||||
&db.get_channel_internal(public_channel_id, &tx)
|
||||
.await
|
||||
.unwrap(),
|
||||
guest,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -629,9 +629,9 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(zed_channel, &*tx).await.unwrap(),
|
||||
&db.get_channel_internal(zed_channel, &tx).await.unwrap(),
|
||||
guest,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -640,11 +640,11 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
assert!(db
|
||||
.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(internal_channel_id, &*tx)
|
||||
&db.get_channel_internal(internal_channel_id, &tx)
|
||||
.await
|
||||
.unwrap(),
|
||||
guest,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
@@ -653,11 +653,11 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
||||
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &*tx)
|
||||
&db.get_channel_internal(public_channel_id, &tx)
|
||||
.await
|
||||
.unwrap(),
|
||||
guest,
|
||||
&*tx,
|
||||
&tx,
|
||||
)
|
||||
.await
|
||||
})
|
||||
|
||||
@@ -297,7 +297,7 @@ async fn test_unseen_channel_messages(db: &Arc<Database>) {
|
||||
// Check that observer has new messages
|
||||
let latest_messages = db
|
||||
.transaction(|tx| async move {
|
||||
db.latest_channel_messages(&[channel_1, channel_2], &*tx)
|
||||
db.latest_channel_messages(&[channel_1, channel_2], &tx)
|
||||
.await
|
||||
})
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user