|
@@ -87,7 +87,7 @@ impl RocksDb {
|
|
|
|
|
|
impl Storage for RocksDb {
|
|
|
type Iterator<'a> = WrapperIterator<'a>;
|
|
|
- fn get_local_events<'a>(&'a self, limit: Option<usize>) -> Result<WrapperIterator<'a>, Error> {
|
|
|
+ fn get_local_events(&self, limit: Option<usize>) -> Result<WrapperIterator<'_>, Error> {
|
|
|
let cf_handle = self.reference_to_cf_handle(ReferenceType::LocalEvents)?;
|
|
|
Ok(WrapperIterator {
|
|
|
db: self,
|
|
@@ -106,8 +106,8 @@ impl Storage for RocksDb {
|
|
|
let secondary_index = SecondaryIndex::new(event_id, event.created_at());
|
|
|
self.db.put_cf(
|
|
|
&self.reference_to_cf_handle(ReferenceType::LocalEvents)?,
|
|
|
- secondary_index.index_by(&[]),
|
|
|
- &event_id.deref(),
|
|
|
+ secondary_index.index_by([]),
|
|
|
+ event_id.deref(),
|
|
|
)?;
|
|
|
Ok(())
|
|
|
}
|
|
@@ -125,7 +125,7 @@ impl Storage for RocksDb {
|
|
|
let author_id = secondary_index.index_by(event.author());
|
|
|
let json = serde_json::to_vec(event)?;
|
|
|
let kind: u32 = event.kind().into();
|
|
|
- let kind_id = secondary_index.index_by(&kind.to_be_bytes());
|
|
|
+ let kind_id = secondary_index.index_by(kind.to_be_bytes());
|
|
|
|
|
|
let mut buffer = WriteBatch::default();
|
|
|
|
|
@@ -147,7 +147,7 @@ impl Storage for RocksDb {
|
|
|
|
|
|
buffer.put_cf(
|
|
|
&self.reference_to_cf_handle(ReferenceType::Stream)?,
|
|
|
- secondary_index.index_by(&[]),
|
|
|
+ secondary_index.index_by([]),
|
|
|
event_id.deref(),
|
|
|
);
|
|
|
|
|
@@ -155,7 +155,7 @@ impl Storage for RocksDb {
|
|
|
match tag {
|
|
|
Tag::PubKey(p) => {
|
|
|
let foreign_id = secondary_index.index_by(&p.id);
|
|
|
- let local_id = secondary_index.index_by(&event_id);
|
|
|
+ let local_id = secondary_index.index_by(event_id);
|
|
|
|
|
|
buffer.put_cf(
|
|
|
&self.reference_to_cf_handle(ReferenceType::RefPublicKey)?,
|
|
@@ -170,7 +170,7 @@ impl Storage for RocksDb {
|
|
|
}
|
|
|
Tag::Event(e) => {
|
|
|
let foreign_id = secondary_index.index_by(&e.id);
|
|
|
- let local_id = secondary_index.index_by(&event_id);
|
|
|
+ let local_id = secondary_index.index_by(event_id);
|
|
|
|
|
|
buffer.put_cf(
|
|
|
&self.reference_to_cf_handle(ReferenceType::RefEvent)?,
|
|
@@ -200,7 +200,7 @@ impl Storage for RocksDb {
|
|
|
.transpose()?)
|
|
|
}
|
|
|
|
|
|
- fn get_by_filter<'a>(&'a self, mut query: Filter) -> Result<WrapperIterator<'a>, Error> {
|
|
|
+ fn get_by_filter(&self, mut query: Filter) -> Result<WrapperIterator<'_>, Error> {
|
|
|
let limit = if query.limit == 0 {
|
|
|
None
|
|
|
} else {
|