mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
Use #[expect], lint reasons
This commit is contained in:
parent
e14b7f28f2
commit
b09c44a0ca
49 changed files with 157 additions and 161 deletions
|
|
@ -72,10 +72,11 @@ fn db_options(max_open_files: i32, rocksdb_cache: &Cache) -> Options {
|
|||
|
||||
impl KeyValueDatabaseEngine for Arc<Engine> {
|
||||
fn open(config: &Config) -> Result<Self> {
|
||||
#[allow(
|
||||
#[expect(
|
||||
clippy::as_conversions,
|
||||
clippy::cast_sign_loss,
|
||||
clippy::cast_possible_truncation
|
||||
clippy::cast_possible_truncation,
|
||||
reason = "saturating to usize is fine"
|
||||
)]
|
||||
let cache_capacity_bytes =
|
||||
(config.database.cache_capacity_mb * 1024.0 * 1024.0) as usize;
|
||||
|
|
@ -144,7 +145,11 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
}))
|
||||
}
|
||||
|
||||
#[allow(clippy::as_conversions, clippy::cast_precision_loss)]
|
||||
#[expect(
|
||||
clippy::as_conversions,
|
||||
clippy::cast_precision_loss,
|
||||
reason = "these are just informational"
|
||||
)]
|
||||
fn memory_usage(&self) -> Result<String> {
|
||||
let stats =
|
||||
get_memory_usage_stats(Some(&[&self.rocks]), Some(&[&self.cache]))?;
|
||||
|
|
|
|||
|
|
@ -124,11 +124,12 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
// 2. divide by permanent connections + permanent iter connections +
|
||||
// write connection
|
||||
// 3. round down to nearest integer
|
||||
#[allow(
|
||||
#[expect(
|
||||
clippy::as_conversions,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::cast_precision_loss,
|
||||
clippy::cast_sign_loss
|
||||
clippy::cast_sign_loss,
|
||||
reason = "saturating to u32 is fine"
|
||||
)]
|
||||
let cache_size_per_thread =
|
||||
((config.database.cache_capacity_mb * 1024.0)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ use tokio::sync::watch;
|
|||
|
||||
#[derive(Default)]
|
||||
pub(super) struct Watchers {
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(
|
||||
clippy::type_complexity,
|
||||
reason = "not actually all that complex"
|
||||
)]
|
||||
watchers:
|
||||
RwLock<HashMap<Vec<u8>, (watch::Sender<()>, watch::Receiver<()>)>>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ impl service::rooms::edus::read_receipt::Data for KeyValueDatabase {
|
|||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
fn readreceipts_since<'a>(
|
||||
&'a self,
|
||||
room_id: &RoomId,
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ impl service::rooms::search::Data for KeyValueDatabase {
|
|||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
fn search_pdus<'a>(
|
||||
&'a self,
|
||||
room_id: &RoomId,
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ impl service::rooms::state_cache::Data for KeyValueDatabase {
|
|||
}
|
||||
|
||||
/// Returns an iterator over all rooms a user was invited to.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
#[tracing::instrument(skip(self))]
|
||||
fn rooms_invited<'a>(
|
||||
&'a self,
|
||||
|
|
@ -575,7 +575,7 @@ impl service::rooms::state_cache::Data for KeyValueDatabase {
|
|||
}
|
||||
|
||||
/// Returns an iterator over all rooms a user left.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
#[tracing::instrument(skip(self))]
|
||||
fn rooms_left<'a>(
|
||||
&'a self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue