chore: Clippy fixes

This commit is contained in:
Ginger committed 2026-08-25 12:37:13 -04:00
1 parent 18b0a87b2d
commit eadcea8034
14 files changed
+66 -52

No files matched your search

+4 -2
View File
@@ -48,8 +48,10 @@ impl Data {
.map_err(|_| err!(Request(NotFound("auth_chain not found"))))?;
let chain = chain
.chunks_exact(size_of::<u64>())
.map(utils::u64_from_u8)
.as_chunks::<{ size_of::<u64>() }>()
.0
.iter()
.map(|s| utils::u64_from_u8(s))
.collect::<Arc<[u64]>>();
// Cache in RAM
+3 -3
View File
@@ -136,14 +136,14 @@ impl Service {
/// Returns a stack with info on shortstatehash, full state, added diff and
/// removed diff for the selected shortstatehash and each parent layer.
async fn cache_shortstatehash_info(
fn cache_shortstatehash_info(
&self,
shortstatehash: ShortStateHash,
stack: ShortStateInfoVec,
) -> Result {
) -> impl Future<Output = Result> {
self.stateinfo_cache.lock().insert(shortstatehash, stack);
Ok(())
std::future::ready(Ok(()))
}
/// Inserts a new shortstatehash info entry.
+2 -3
View File
@@ -82,8 +82,7 @@ impl super::Service {
))));
},
| StateEventType::RoomServerAcl =>
self.assert_allowed_to_send_room_server_acl_event(room_id, json)
.await?,
self.assert_allowed_to_send_room_server_acl_event(room_id, json)?,
| StateEventType::RoomEncryption =>
// Forbid m.room.encryption if encryption is disabled
if !self.services.config.allow_encryption {
@@ -109,7 +108,7 @@ impl super::Service {
Ok(())
}
async fn assert_allowed_to_send_room_server_acl_event(
fn assert_allowed_to_send_room_server_acl_event(
&self,
room_id: &RoomId,
json: &Raw<AnyStateEventContent>,