mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-10 17:02:50 +02:00
style(hydra): Satisfy clippy's twisted and confusing demands
This commit is contained in:
parent
d221491377
commit
ef42638f3c
9 changed files with 32 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
)?,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue