enable let_underscore_must_use lint

This commit is contained in:
Charles Hall 2024-05-12 17:02:08 -07:00
parent 2ded335adb
commit 052f3088e9
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
12 changed files with 69 additions and 32 deletions

View file

@ -1400,7 +1400,9 @@ pub(crate) async fn leave_all_rooms(user_id: &UserId) -> Result<()> {
Err(_) => continue,
};
let _ = leave_room(user_id, &room_id, None).await;
if let Err(error) = leave_room(user_id, &room_id, None).await {
warn!(%user_id, %room_id, %error, "failed to leave room");
}
}
Ok(())

View file

@ -13,6 +13,7 @@ use ruma::{
};
use serde_json::value::to_raw_value;
use std::sync::Arc;
use tracing::warn;
/// # `PUT /_matrix/client/r0/profile/{userId}/displayname`
///
@ -84,11 +85,14 @@ pub(crate) async fn set_displayname_route(
);
let state_lock = mutex_state.lock().await;
let _ = services()
if let Err(error) = services()
.rooms
.timeline
.build_and_append_pdu(pdu_builder, sender_user, &room_id, &state_lock)
.await;
.await
{
warn!(%error, "failed to add PDU");
}
}
Ok(set_display_name::v3::Response {})
@ -198,11 +202,14 @@ pub(crate) async fn set_avatar_url_route(
);
let state_lock = mutex_state.lock().await;
let _ = services()
if let Err(error) = services()
.rooms
.timeline
.build_and_append_pdu(pdu_builder, sender_user, &room_id, &state_lock)
.await;
.await
{
warn!(%error, "failed to add PDU");
};
}
Ok(set_avatar_url::v3::Response {})

View file

@ -480,7 +480,11 @@ pub(crate) async fn create_room_route(
// 8. Events implied by invite (and TODO: invite_3pid)
drop(state_lock);
for user_id in &body.invite {
let _ = invite_helper(sender_user, user_id, &room_id, None, body.is_direct).await;
if let Err(error) =
invite_helper(sender_user, user_id, &room_id, None, body.is_direct).await
{
warn!(%error, "invite helper failed");
};
}
// Homeserver specific stuff

View file

@ -29,7 +29,7 @@ use std::{
time::Duration,
};
use tokio::sync::watch::Sender;
use tracing::{error, info};
use tracing::{debug, error, info};
/// # `GET /_matrix/client/r0/sync`
///
@ -164,7 +164,8 @@ async fn sync_helper_wrapper(
}
}
let _ = tx.send(Some(r.map(|(r, _)| r)));
tx.send(Some(r.map(|(r, _)| r)))
.expect("receiver should not be dropped");
}
async fn sync_helper(
@ -543,7 +544,10 @@ async fn sync_helper(
if duration.as_secs() > 30 {
duration = Duration::from_secs(30);
}
let _ = tokio::time::timeout(duration, watcher).await;
match tokio::time::timeout(duration, watcher).await {
Ok(x) => x.expect("watcher should succeed"),
Err(error) => debug!(%error, "timed out"),
};
Ok((response, false))
} else {
Ok((response, since != next_batch)) // Only cache if we made progress
@ -1681,7 +1685,10 @@ pub(crate) async fn sync_events_v4_route(
if duration.as_secs() > 30 {
duration = Duration::from_secs(30);
}
let _ = tokio::time::timeout(duration, watcher).await;
match tokio::time::timeout(duration, watcher).await {
Ok(x) => x.expect("watcher should succeed"),
Err(error) => debug!(%error, "timed out"),
};
}
Ok(sync_events::v4::Response {