refactor: make cargo clippy happier
This commit is contained in:
parent
1dbde0e1c1
commit
8e041f90dd
6 changed files with 23 additions and 31 deletions
|
@ -33,13 +33,12 @@ impl AccountData {
|
|||
.rev()
|
||||
.filter_map(|r| r.ok())
|
||||
.take_while(|key| key.starts_with(&prefix))
|
||||
.filter(|key| {
|
||||
.find(|key| {
|
||||
key.split(|&b| b == 0xff)
|
||||
.nth(1)
|
||||
.filter(|&user| user == user_id.to_string().as_bytes())
|
||||
.is_some()
|
||||
})
|
||||
.next()
|
||||
{
|
||||
// This is the old room_latest
|
||||
self.roomuserdataid_accountdata.remove(old)?;
|
||||
|
|
|
@ -261,14 +261,14 @@ impl Rooms {
|
|||
self.pduid_pdu.insert(&pdu_id, &*pdu_json.to_string())?;
|
||||
|
||||
self.eventid_pduid
|
||||
.insert(pdu.event_id.to_string(), pdu_id.clone())?;
|
||||
.insert(pdu.event_id.to_string(), pdu_id)?;
|
||||
|
||||
if let Some(state_key) = pdu.state_key {
|
||||
let mut key = room_id.to_string().as_bytes().to_vec();
|
||||
key.push(0xff);
|
||||
key.extend_from_slice(pdu.kind.to_string().as_bytes());
|
||||
key.push(0xff);
|
||||
key.extend_from_slice(state_key.to_string().as_bytes());
|
||||
key.extend_from_slice(state_key.as_bytes());
|
||||
self.roomstateid_pdu.insert(key, &*pdu_json.to_string())?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue