fix type complexity
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
95121b6e05
commit
a95ded167f
1 changed files with 6 additions and 4 deletions
|
@ -12,17 +12,19 @@ use ruma::{DeviceId, OwnedDeviceId, OwnedRoomId, OwnedUserId, RoomId, UserId};
|
||||||
use self::data::Data;
|
use self::data::Data;
|
||||||
|
|
||||||
pub struct Service {
|
pub struct Service {
|
||||||
|
pub lazy_load_waiting: Mutex<LazyLoadWaiting>,
|
||||||
db: Data,
|
db: Data,
|
||||||
|
|
||||||
#[allow(clippy::type_complexity)]
|
|
||||||
pub lazy_load_waiting: Mutex<HashMap<(OwnedUserId, OwnedDeviceId, OwnedRoomId, PduCount), HashSet<OwnedUserId>>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LazyLoadWaiting = HashMap<LazyLoadWaitingKey, LazyLoadWaitingVal>;
|
||||||
|
type LazyLoadWaitingKey = (OwnedUserId, OwnedDeviceId, OwnedRoomId, PduCount);
|
||||||
|
type LazyLoadWaitingVal = HashSet<OwnedUserId>;
|
||||||
|
|
||||||
impl crate::Service for Service {
|
impl crate::Service for Service {
|
||||||
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||||
Ok(Arc::new(Self {
|
Ok(Arc::new(Self {
|
||||||
db: Data::new(args.db),
|
|
||||||
lazy_load_waiting: Mutex::new(HashMap::new()),
|
lazy_load_waiting: Mutex::new(HashMap::new()),
|
||||||
|
db: Data::new(args.db),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue