mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-10-09 19:10:50 +00:00
style(hydra): Satisfy clippy's twisted and confusing demands
This commit is contained in:
parent
4024349424
commit
c2620ba57b
9 changed files with 32 additions and 15 deletions
|
@ -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