From 82f10214b3b5ad9ea17d24d8517b8e8942d91aff Mon Sep 17 00:00:00 2001 From: strawberry Date: Wed, 28 Feb 2024 12:40:41 -0500 Subject: [PATCH] remove all unused lifetimes Signed-off-by: strawberry --- Cargo.toml | 2 +- src/database/abstraction/rocksdb.rs | 4 ++-- src/database/key_value/rooms/search.rs | 2 +- src/database/key_value/rooms/state.rs | 2 +- src/service/rooms/search/mod.rs | 2 +- src/service/rooms/timeline/mod.rs | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bb5906da..deab6a15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -209,7 +209,7 @@ explicit_outlives_requirements = "warn" # unreachable_pub = "warn" unused_extern_crates = "warn" unused_import_braces = "warn" -# unused_lifetimes = "warn" +unused_lifetimes = "warn" unused_qualifications = "warn" dead_code = "warn" diff --git a/src/database/abstraction/rocksdb.rs b/src/database/abstraction/rocksdb.rs index dce30c91..d67f7431 100644 --- a/src/database/abstraction/rocksdb.rs +++ b/src/database/abstraction/rocksdb.rs @@ -190,7 +190,7 @@ impl KvTree for RocksDbEngineTree<'_> { Ok(()) } - fn insert_batch<'a>(&self, iter: &mut dyn Iterator, Vec)>) -> Result<()> { + fn insert_batch(&self, iter: &mut dyn Iterator, Vec)>) -> Result<()> { for (key, value) in iter { self.db.rocks.put_cf(&self.cf(), key, value)?; } @@ -247,7 +247,7 @@ impl KvTree for RocksDbEngineTree<'_> { Ok(new) } - fn increment_batch<'a>(&self, iter: &mut dyn Iterator>) -> Result<()> { + fn increment_batch(&self, iter: &mut dyn Iterator>) -> Result<()> { let lock = self.write_lock.write().unwrap(); for key in iter { diff --git a/src/database/key_value/rooms/search.rs b/src/database/key_value/rooms/search.rs index 9aceaa63..128b3019 100644 --- a/src/database/key_value/rooms/search.rs +++ b/src/database/key_value/rooms/search.rs @@ -5,7 +5,7 @@ use crate::{database::KeyValueDatabase, service, services, utils, Result}; type SearchPdusResult<'a> = Result> + 'a>, Vec)>>; impl service::rooms::search::Data for KeyValueDatabase { - fn index_pdu<'a>(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> { + fn index_pdu(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> { let mut batch = message_body .split_terminator(|c: char| !c.is_alphanumeric()) .filter(|s| !s.is_empty()) diff --git a/src/database/key_value/rooms/state.rs b/src/database/key_value/rooms/state.rs index f17d37bb..6865d7b9 100644 --- a/src/database/key_value/rooms/state.rs +++ b/src/database/key_value/rooms/state.rs @@ -49,7 +49,7 @@ impl service::rooms::state::Data for KeyValueDatabase { .collect() } - fn set_forward_extremities<'a>( + fn set_forward_extremities( &self, room_id: &RoomId, event_ids: Vec, diff --git a/src/service/rooms/search/mod.rs b/src/service/rooms/search/mod.rs index b6f35e79..139169ef 100644 --- a/src/service/rooms/search/mod.rs +++ b/src/service/rooms/search/mod.rs @@ -11,7 +11,7 @@ pub struct Service { impl Service { #[tracing::instrument(skip(self))] - pub fn index_pdu<'a>(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> { + pub fn index_pdu(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> { self.db.index_pdu(shortroomid, pdu_id, message_body) } diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 7cebaf30..a96d8748 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -224,7 +224,7 @@ impl Service { /// /// Returns pdu id #[tracing::instrument(skip(self, pdu, pdu_json, leaves))] - pub async fn append_pdu<'a>( + pub async fn append_pdu( &self, pdu: &PduEvent, mut pdu_json: CanonicalJsonObject, @@ -1041,7 +1041,7 @@ impl Service { /// Append the incoming event setting the state snapshot to the state from the /// server that sent the event. #[tracing::instrument(skip_all)] - pub async fn append_incoming_pdu<'a>( + pub async fn append_incoming_pdu( &self, pdu: &PduEvent, pdu_json: CanonicalJsonObject,