cargo clippy
This commit is contained in:
parent
ca82b2940d
commit
f430b87459
32 changed files with 139 additions and 166 deletions
|
@ -9,7 +9,7 @@ impl service::rooms::alias::Data for KeyValueDatabase {
|
|||
let mut aliasid = room_id.as_bytes().to_vec();
|
||||
aliasid.push(0xff);
|
||||
aliasid.extend_from_slice(&services().globals.next_count()?.to_be_bytes());
|
||||
self.aliasid_alias.insert(&aliasid, &*alias.as_bytes())?;
|
||||
self.aliasid_alias.insert(&aliasid, alias.as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase {
|
|||
|
||||
for (key, value) in self
|
||||
.presenceid_presence
|
||||
.iter_from(&*first_possible_edu, false)
|
||||
.iter_from(&first_possible_edu, false)
|
||||
.take_while(|(key, _)| key.starts_with(&prefix))
|
||||
{
|
||||
let user_id = UserId::parse(
|
||||
|
|
|
@ -17,7 +17,7 @@ impl service::rooms::edus::typing::Data for KeyValueDatabase {
|
|||
room_typing_id.extend_from_slice(&count);
|
||||
|
||||
self.typingid_userid
|
||||
.insert(&room_typing_id, &*user_id.as_bytes())?;
|
||||
.insert(&room_typing_id, user_id.as_bytes())?;
|
||||
|
||||
self.roomid_lasttypingupdate
|
||||
.insert(room_id.as_bytes(), &count)?;
|
||||
|
|
|
@ -15,7 +15,7 @@ impl service::rooms::search::Data for KeyValueDatabase {
|
|||
let mut key = shortroomid.to_be_bytes().to_vec();
|
||||
key.extend_from_slice(word.as_bytes());
|
||||
key.push(0xff);
|
||||
key.extend_from_slice(&pdu_id);
|
||||
key.extend_from_slice(pdu_id);
|
||||
(key, Vec::new())
|
||||
});
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ impl service::rooms::timeline::Data for KeyValueDatabase {
|
|||
{
|
||||
hash_map::Entry::Vacant(v) => {
|
||||
if let Some(last_count) = self
|
||||
.pdus_until(&sender_user, &room_id, u64::MAX)?
|
||||
.pdus_until(sender_user, room_id, u64::MAX)?
|
||||
.filter_map(|r| {
|
||||
// Filter out buggy events
|
||||
if r.is_err() {
|
||||
|
@ -205,8 +205,7 @@ impl service::rooms::timeline::Data for KeyValueDatabase {
|
|||
.unwrap()
|
||||
.insert(pdu.room_id.clone(), count);
|
||||
|
||||
self.eventid_pduid
|
||||
.insert(pdu.event_id.as_bytes(), &pdu_id)?;
|
||||
self.eventid_pduid.insert(pdu.event_id.as_bytes(), pdu_id)?;
|
||||
self.eventid_outlierpdu.remove(pdu.event_id.as_bytes())?;
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -114,7 +114,7 @@ impl service::rooms::user::Data for KeyValueDatabase {
|
|||
utils::common_elements(iterators, Ord::cmp)
|
||||
.expect("users is not empty")
|
||||
.map(|bytes| {
|
||||
RoomId::parse(utils::string_from_bytes(&*bytes).map_err(|_| {
|
||||
RoomId::parse(utils::string_from_bytes(&bytes).map_err(|_| {
|
||||
Error::bad_database("Invalid RoomId bytes in userroomid_joined")
|
||||
})?)
|
||||
.map_err(|_| Error::bad_database("Invalid RoomId in userroomid_joined."))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue