enable dead_code lint

And delete all the dead code. And add some cfgs for feature-specific
items.
This commit is contained in:
Charles Hall 2024-05-01 22:32:36 -07:00
parent d748544f0e
commit 2ff08c9fc4
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
8 changed files with 6 additions and 52 deletions

View file

@ -8,7 +8,7 @@ use futures_util::Future;
use regex::RegexSet;
use ruma::{
api::appservice::{Namespace, Registration},
RoomAliasId, RoomId, UserId,
RoomAliasId, UserId,
};
use tokio::sync::RwLock;
@ -207,14 +207,6 @@ impl Service {
.any(|info| info.aliases.is_exclusive_match(alias.as_str()))
}
// Checks if a given room id matches any exclusive appservice regex
pub(crate) async fn is_exclusive_room_id(&self, room_id: &RoomId) -> bool {
self.read()
.await
.values()
.any(|info| info.rooms.is_exclusive_match(room_id.as_str()))
}
pub(crate) fn read(
&self,
) -> impl Future<Output = tokio::sync::RwLockReadGuard<'_, BTreeMap<String, RegistrationInfo>>>

View file

@ -399,10 +399,6 @@ impl Service {
r
}
pub(crate) fn well_known_client(&self) -> &Option<String> {
&self.config.well_known_client
}
pub(crate) fn shutdown(&self) {
self.shutdown.store(true, atomic::Ordering::Relaxed);
// On shutdown

View file

@ -3,7 +3,7 @@ mod data;
pub(crate) use data::Data;
use ruma::{CanonicalJsonObject, EventId};
use crate::{PduEvent, Result};
use crate::Result;
pub(crate) struct Service {
pub(crate) db: &'static dyn Data,
@ -18,11 +18,6 @@ impl Service {
self.db.get_outlier_pdu_json(event_id)
}
/// Returns the pdu from the outlier tree.
pub(crate) fn get_pdu_outlier(&self, event_id: &EventId) -> Result<Option<PduEvent>> {
self.db.get_outlier_pdu(event_id)
}
/// Append the PDU as an outlier.
#[tracing::instrument(skip(self, pdu))]
pub(crate) fn add_pdu_outlier(

View file

@ -159,13 +159,6 @@ impl Service {
self.db.get_pdu_id(event_id)
}
/// Returns the pdu.
///
/// Checks the `eventid_outlierpdu` Tree if not found in the timeline.
pub(crate) fn get_non_outlier_pdu(&self, event_id: &EventId) -> Result<Option<PduEvent>> {
self.db.get_non_outlier_pdu(event_id)
}
/// Returns the pdu.
///
/// Checks the `eventid_outlierpdu` Tree if not found in the timeline.

View file

@ -397,10 +397,6 @@ impl Service {
.add_one_time_key(user_id, device_id, one_time_key_key, one_time_key_value)
}
pub(crate) fn last_one_time_keys_update(&self, user_id: &UserId) -> Result<u64> {
self.db.last_one_time_keys_update(user_id)
}
pub(crate) fn take_one_time_key(
&self,
user_id: &UserId,