style(hydra): Satisfy clippy's twisted and confusing demands

This commit is contained in:
nexy7574 2025-09-02 02:34:13 +01:00
commit ef42638f3c
No known key found for this signature in database
9 changed files with 32 additions and 15 deletions

View file

@ -425,6 +425,7 @@ impl Service {
.await
{
self.handle_response_error(e, room_id, user_id, &state_lock)
.boxed()
.await
.unwrap_or_else(default_log);
}

View file

@ -34,6 +34,7 @@ use crate::{appservice::NamespaceRegex, rooms::state_compressor::CompressedState
/// the server that sent the event.
#[implement(super::Service)]
#[tracing::instrument(level = "debug", skip_all)]
#[allow(clippy::too_many_arguments)]
pub async fn append_incoming_pdu<'a, Leaves>(
&'a self,
pdu: &'a PduEvent,

View file

@ -32,12 +32,13 @@ pub async fn create_hash_and_sign_event(
_mutex_lock: &RoomMutexGuard, /* Take mutex guard to make sure users get the room
* state mutex */
) -> Result<(PduEvent, CanonicalJsonObject)> {
#[allow(clippy::boxed_local)]
fn from_evt(
room_id: OwnedRoomId,
event_type: TimelineEventType,
content: Box<RawValue>,
event_type: &TimelineEventType,
content: &RawValue,
) -> Result<RoomVersionId> {
if event_type == TimelineEventType::RoomCreate {
if event_type == &TimelineEventType::RoomCreate {
let content: RoomCreateEventContent = serde_json::from_str(content.get())?;
Ok(content.room_version)
} else {
@ -62,11 +63,11 @@ pub async fn create_hash_and_sign_event(
.state
.get_room_version(room_id)
.await
.or_else(|_| from_evt(room_id.to_owned(), event_type.clone(), content.clone()))?,
.or_else(|_| from_evt(room_id.to_owned(), &event_type.clone(), &content.clone()))?,
| None => from_evt(
RoomId::new(self.services.globals.server_name()),
event_type.clone(),
content.clone(),
&event_type.clone(),
&content.clone(),
)?,
};