|
@@ -7,7 +7,6 @@ use std::{
|
|
atomic::{AtomicUsize, Ordering},
|
|
atomic::{AtomicUsize, Ordering},
|
|
Arc,
|
|
Arc,
|
|
},
|
|
},
|
|
- u64,
|
|
|
|
};
|
|
};
|
|
use tokio::sync::RwLock;
|
|
use tokio::sync::RwLock;
|
|
|
|
|
|
@@ -80,7 +79,7 @@ impl Storage for Memory {
|
|
.ids_by_time
|
|
.ids_by_time
|
|
.write()
|
|
.write()
|
|
.await
|
|
.await
|
|
- .insert(secondary_index.index_by(&time_desc), event_id.clone());
|
|
|
|
|
|
+ .insert(secondary_index.index_by(time_desc), event_id.clone());
|
|
|
|
|
|
indexes
|
|
indexes
|
|
.author
|
|
.author
|
|
@@ -133,7 +132,7 @@ impl Storage for Memory {
|
|
async fn set_local_event(&self, event: &Event) -> Result<(), Error> {
|
|
async fn set_local_event(&self, event: &Event) -> Result<(), Error> {
|
|
let mut local_events = self.indexes.local_events.write().await;
|
|
let mut local_events = self.indexes.local_events.write().await;
|
|
local_events.insert(
|
|
local_events.insert(
|
|
- SecondaryIndex::new(&event.id, event.created_at()).index_by(&[]),
|
|
|
|
|
|
+ SecondaryIndex::new(&event.id, event.created_at()).index_by([]),
|
|
event.id.0.to_vec(),
|
|
event.id.0.to_vec(),
|
|
);
|
|
);
|
|
Ok(())
|
|
Ok(())
|