fix edition 2024 lints
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
cbf207bd1f
commit
a67ab75417
36 changed files with 60 additions and 72 deletions
|
@ -172,7 +172,7 @@ impl std::fmt::Display for BlurhashingError {
|
|||
#[cfg(feature = "blurhashing")]
|
||||
| Self::ImageError(e) =>
|
||||
write!(f, "There was an error with the image loading library => {e}")?,
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ async fn location_request(&self, location: &str) -> Result<FileMeta> {
|
|||
.map_err(Into::into)
|
||||
.map(|content| FileMeta {
|
||||
content: Some(content),
|
||||
content_type: content_type.clone().map(Into::into),
|
||||
content_type: content_type.clone(),
|
||||
content_disposition: Some(make_content_disposition(
|
||||
content_disposition.as_ref(),
|
||||
content_type.as_deref(),
|
||||
|
|
|
@ -170,7 +170,7 @@ pub async fn handle_incoming_pdu<'a>(
|
|||
| Entry::Occupied(mut e) => {
|
||||
*e.get_mut() = (now, e.get().1.saturating_add(1));
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ pub async fn get_summary_and_children_local(
|
|||
SummaryAccessibility::Inaccessible
|
||||
},
|
||||
)),
|
||||
};
|
||||
}
|
||||
|
||||
let children_pdus: Vec<_> = self
|
||||
.get_stripped_space_child_events(current_room)
|
||||
|
|
|
@ -218,7 +218,7 @@ impl Service {
|
|||
)
|
||||
.await
|
||||
.ok();
|
||||
};
|
||||
}
|
||||
|
||||
// Copy direct chat flag
|
||||
if let Ok(mut direct_event) = self
|
||||
|
@ -250,7 +250,7 @@ impl Service {
|
|||
)
|
||||
.await?;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ impl Service {
|
|||
});
|
||||
|
||||
return Ok(());
|
||||
};
|
||||
}
|
||||
|
||||
// Else we have two options.
|
||||
// 1. We add the current diff on top of the parent layer.
|
||||
|
@ -419,7 +419,7 @@ impl Service {
|
|||
2, // every state change is 2 event changes on average
|
||||
states_parents,
|
||||
)?;
|
||||
};
|
||||
}
|
||||
|
||||
Ok(HashSetCompressStateEvent {
|
||||
shortstatehash: new_shortstatehash,
|
||||
|
|
|
@ -422,7 +422,7 @@ impl Service {
|
|||
highlight = true;
|
||||
},
|
||||
| _ => {},
|
||||
};
|
||||
}
|
||||
|
||||
// Break early if both conditions are true
|
||||
if notify && highlight {
|
||||
|
@ -484,7 +484,7 @@ impl Service {
|
|||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
| TimelineEventType::SpaceChild =>
|
||||
if let Some(_state_key) = &pdu.state_key {
|
||||
|
@ -776,7 +776,7 @@ impl Service {
|
|||
| _ => {
|
||||
pdu_json.remove("event_id");
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Add origin because synapse likes that (and it's required in the spec)
|
||||
pdu_json.insert(
|
||||
|
@ -847,7 +847,7 @@ impl Service {
|
|||
{
|
||||
return Err!(Request(Forbidden("User cannot redact this event.")));
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
| _ => {
|
||||
let content: RoomRedactionEventContent = pdu.get_content()?;
|
||||
|
@ -863,7 +863,7 @@ impl Service {
|
|||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if pdu.kind == TimelineEventType::RoomMember {
|
||||
let content: RoomMemberEventContent = pdu.get_content()?;
|
||||
|
@ -1293,10 +1293,10 @@ async fn check_pdu_for_admin_room(&self, pdu: &PduEvent, sender: &UserId) -> Res
|
|||
}
|
||||
},
|
||||
| _ => {},
|
||||
};
|
||||
}
|
||||
},
|
||||
| _ => {},
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ impl crate::Service for Service {
|
|||
| Err(error) => {
|
||||
error!(id = ?error.id(), ?error, "sender worker finished");
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -138,7 +138,7 @@ impl Service {
|
|||
match response {
|
||||
| Ok(dest) => self.handle_response_ok(&dest, futures, statuses).await,
|
||||
| Err((dest, e)) => Self::handle_response_err(dest, statuses, &e),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_response_err(dest: Destination, statuses: &mut CurTransactionStatus, e: &Error) {
|
||||
|
@ -319,10 +319,7 @@ impl Service {
|
|||
if let Destination::Federation(server_name) = dest {
|
||||
if let Ok((select_edus, last_count)) = self.select_edus(server_name).await {
|
||||
debug_assert!(select_edus.len() <= EDU_LIMIT, "exceeded edus limit");
|
||||
let select_edus = select_edus
|
||||
.into_iter()
|
||||
.map(Into::into)
|
||||
.map(SendingEvent::Edu);
|
||||
let select_edus = select_edus.into_iter().map(SendingEvent::Edu);
|
||||
|
||||
events.extend(select_edus);
|
||||
self.db.set_latest_educount(server_name, last_count);
|
||||
|
|
|
@ -43,7 +43,7 @@ where
|
|||
.keys()
|
||||
.rev()
|
||||
.take(self.services.server.config.trusted_server_batch_size)
|
||||
.last()
|
||||
.next_back()
|
||||
.cloned()
|
||||
{
|
||||
let request = Request {
|
||||
|
|
|
@ -69,7 +69,7 @@ pub async fn read_tokens(&self) -> Result<HashSet<String>> {
|
|||
},
|
||||
| Err(e) => error!("Failed to read the registration token file: {e}"),
|
||||
}
|
||||
};
|
||||
}
|
||||
if let Some(token) = &self.services.config.registration_token {
|
||||
tokens.insert(token.to_owned());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue