enable dead_code lint

This commit is contained in:
Charles Hall 2024-05-21 21:58:43 -07:00
parent 518d0c9cf3
commit d7e945f4c5
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
17 changed files with 15 additions and 137 deletions

View file

@ -83,7 +83,10 @@ pub(crate) struct Service {
/// the database.
pub(crate) struct RotationHandler(
broadcast::Sender<()>,
broadcast::Receiver<()>,
// TODO: Determine if it's safe to delete this field. I'm not deleting it
// right now because I'm unsure what implications that would have for how
// the sender expects to work.
#[allow(dead_code)] broadcast::Receiver<()>,
);
impl RotationHandler {

View file

@ -39,6 +39,8 @@ pub(crate) trait Data: Send + Sync {
) -> Result<()>;
/// Returns the private read marker.
// TODO: Implement MSC2285
#[allow(dead_code)]
fn private_read_get(
&self,
room_id: &RoomId,
@ -46,6 +48,8 @@ pub(crate) trait Data: Send + Sync {
) -> Result<Option<u64>>;
/// Returns the count of the last typing update in this room.
// TODO: Implement MSC2285
#[allow(dead_code)]
fn last_privateread_update(
&self,
user_id: &UserId,

View file

@ -1,6 +1,6 @@
use ruma::{CanonicalJsonObject, EventId};
use crate::{PduEvent, Result};
use crate::Result;
pub(crate) trait Data: Send + Sync {
/// Returns the pdu from the outlier tree.
@ -8,7 +8,7 @@ pub(crate) trait Data: Send + Sync {
&self,
event_id: &EventId,
) -> Result<Option<CanonicalJsonObject>>;
fn get_outlier_pdu(&self, event_id: &EventId) -> Result<Option<PduEvent>>;
/// Append the PDU as an outlier.
fn add_pdu_outlier(
&self,

View file

@ -313,15 +313,6 @@ impl Service {
self.db.room_invited_count(room_id)
}
/// Returns an iterator over all User IDs who ever joined a room.
#[tracing::instrument(skip(self))]
pub(crate) fn room_useroncejoined<'a>(
&'a self,
room_id: &RoomId,
) -> impl Iterator<Item = Result<OwnedUserId>> + 'a {
self.db.room_useroncejoined(room_id)
}
/// Returns an iterator over all invited members of a room.
#[tracing::instrument(skip(self))]
pub(crate) fn room_members_invited<'a>(

View file

@ -68,12 +68,6 @@ pub(crate) trait Data: Send + Sync {
fn room_invited_count(&self, room_id: &RoomId) -> Result<Option<u64>>;
/// Returns an iterator over all User IDs who ever joined a room.
fn room_useroncejoined<'a>(
&'a self,
room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedUserId>> + 'a>;
/// Returns an iterator over all invited members of a room.
fn room_members_invited<'a>(
&'a self,
@ -137,5 +131,7 @@ pub(crate) trait Data: Send + Sync {
fn is_invited(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool>;
// TODO: Use this when implementing sync filtering
#[allow(dead_code)]
fn is_left(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool>;
}

View file

@ -588,17 +588,6 @@ impl Service {
Ok(())
}
/// Cleanup event data
/// Used for instance after we remove an appservice registration
#[tracing::instrument(skip(self))]
pub(crate) fn cleanup_events(&self, appservice_id: String) -> Result<()> {
self.db.delete_all_requests_for(&OutgoingKind::Appservice(
appservice_id,
))?;
Ok(())
}
#[tracing::instrument(skip(events))]
async fn handle_events(
kind: OutgoingKind,

View file

@ -20,10 +20,6 @@ pub(crate) trait Data: Send + Sync {
&self,
outgoing_kind: &OutgoingKind,
) -> Result<()>;
fn delete_all_requests_for(
&self,
outgoing_kind: &OutgoingKind,
) -> Result<()>;
fn queue_requests(
&self,
requests: &[(&OutgoingKind, SendingEventType)],

View file

@ -116,8 +116,6 @@ pub(crate) trait Data: Send + Sync {
one_time_key_value: &Raw<OneTimeKey>,
) -> Result<()>;
fn last_one_time_keys_update(&self, user_id: &UserId) -> Result<u64>;
fn take_one_time_key(
&self,
user_id: &UserId,