diff --git a/src/service/rooms/state_cache/data.rs b/src/service/rooms/state_cache/data.rs index 1c0571c95781f48c90967d2719a3cfaf11f26b7b..acf390d989939d20bf0de05e3337e050442fa170 100644 --- a/src/service/rooms/state_cache/data.rs +++ b/src/service/rooms/state_cache/data.rs @@ -72,7 +72,7 @@ fn mark_as_invited( fn get_left_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<Option<u64>>; /// Returns an iterator over all rooms this user joined. - fn rooms_joined<'a>(&'a self, user_id: &UserId) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + 'a>; + fn rooms_joined(&self, user_id: &UserId) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + '_>; /// Returns an iterator over all rooms a user was invited to. fn rooms_invited<'a>(&'a self, user_id: &UserId) -> StrippedStateEventIter<'a>; @@ -494,7 +494,7 @@ fn get_left_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<Option<u6 /// Returns an iterator over all rooms this user joined. #[tracing::instrument(skip(self))] - fn rooms_joined<'a>(&'a self, user_id: &UserId) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + 'a> { + fn rooms_joined(&self, user_id: &UserId) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + '_> { Box::new( self.userroomid_joined .scan_prefix(user_id.as_bytes().to_vec()) diff --git a/src/service/rooms/state_cache/mod.rs b/src/service/rooms/state_cache/mod.rs index 1cfd56db6ca0ef39a917f1d189ab972435b525f5..2b3f5fb7bbd93da8e06938f0366a996cef513fa9 100644 --- a/src/service/rooms/state_cache/mod.rs +++ b/src/service/rooms/state_cache/mod.rs @@ -239,7 +239,7 @@ pub fn forget(&self, room_id: &RoomId, user_id: &UserId) -> Result<()> { self.db /// Returns an iterator of all servers participating in this room. #[tracing::instrument(skip(self))] - pub fn room_servers<'a>(&'a self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedServerName>> + 'a { + pub fn room_servers(&self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedServerName>> + '_ { self.db.room_servers(room_id) } @@ -251,7 +251,7 @@ pub fn server_in_room(&self, server: &ServerName, room_id: &RoomId) -> Result<bo /// Returns an iterator of all rooms a server participates in (as far as we /// know). #[tracing::instrument(skip(self))] - pub fn server_rooms<'a>(&'a self, server: &ServerName) -> impl Iterator<Item = Result<OwnedRoomId>> + 'a { + pub fn server_rooms(&self, server: &ServerName) -> impl Iterator<Item = Result<OwnedRoomId>> + '_ { self.db.server_rooms(server) } @@ -282,7 +282,7 @@ pub fn user_sees_user(&self, user_a: &UserId, user_b: &UserId) -> Result<bool> { /// Returns an iterator over all joined members of a room. #[tracing::instrument(skip(self))] - pub fn room_members<'a>(&'a self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + 'a { + pub fn room_members(&self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + '_ { self.db.room_members(room_id) } @@ -308,13 +308,13 @@ pub fn room_invited_count(&self, room_id: &RoomId) -> Result<Option<u64>> { self /// Returns an iterator over all User IDs who ever joined a room. #[tracing::instrument(skip(self))] - pub fn room_useroncejoined<'a>(&'a self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + 'a { + pub fn room_useroncejoined(&self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + '_ { self.db.room_useroncejoined(room_id) } /// Returns an iterator over all invited members of a room. #[tracing::instrument(skip(self))] - pub fn room_members_invited<'a>(&'a self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + 'a { + pub fn room_members_invited(&self, room_id: &RoomId) -> impl Iterator<Item = Result<OwnedUserId>> + '_ { self.db.room_members_invited(room_id) } @@ -330,15 +330,15 @@ pub fn get_left_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<Optio /// Returns an iterator over all rooms this user joined. #[tracing::instrument(skip(self))] - pub fn rooms_joined<'a>(&'a self, user_id: &UserId) -> impl Iterator<Item = Result<OwnedRoomId>> + 'a { + pub fn rooms_joined(&self, user_id: &UserId) -> impl Iterator<Item = Result<OwnedRoomId>> + '_ { self.db.rooms_joined(user_id) } /// Returns an iterator over all rooms a user was invited to. #[tracing::instrument(skip(self))] - pub fn rooms_invited<'a>( - &'a self, user_id: &UserId, - ) -> impl Iterator<Item = Result<(OwnedRoomId, Vec<Raw<AnyStrippedStateEvent>>)>> + 'a { + pub fn rooms_invited( + &self, user_id: &UserId, + ) -> impl Iterator<Item = Result<(OwnedRoomId, Vec<Raw<AnyStrippedStateEvent>>)>> + '_ { self.db.rooms_invited(user_id) } @@ -354,9 +354,9 @@ pub fn left_state(&self, user_id: &UserId, room_id: &RoomId) -> Result<Option<Ve /// Returns an iterator over all rooms a user left. #[tracing::instrument(skip(self))] - pub fn rooms_left<'a>( - &'a self, user_id: &UserId, - ) -> impl Iterator<Item = Result<(OwnedRoomId, Vec<Raw<AnySyncStateEvent>>)>> + 'a { + pub fn rooms_left( + &self, user_id: &UserId, + ) -> impl Iterator<Item = Result<(OwnedRoomId, Vec<Raw<AnySyncStateEvent>>)>> + '_ { self.db.rooms_left(user_id) }