diff --git a/Cargo.toml b/Cargo.toml index a36e1fd1..7c263042 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -715,7 +715,6 @@ correctness = "warn" nursery = "warn" ## some sadness -branches_sharing_code = { level = "allow", priority = 1 } # TODO derive_partial_eq_without_eq = { level = "allow", priority = 1 } # TODO equatable_if_let = { level = "allow", priority = 1 } # TODO future_not_send = { level = "allow", priority = 1 } # TODO diff --git a/src/database/rocksdb/mod.rs b/src/database/rocksdb/mod.rs index 28ce5072..f0c3882f 100644 --- a/src/database/rocksdb/mod.rs +++ b/src/database/rocksdb/mod.rs @@ -182,7 +182,7 @@ impl KeyValueDatabaseEngine for Arc { let options = BackupEngineOptions::new(path.unwrap())?; let mut engine = BackupEngine::open(&options, &self.env)?; - let ret = if self.config.database_backups_to_keep > 0 { + if self.config.database_backups_to_keep > 0 { if let Err(e) = engine.create_new_backup_flush(&self.rocks, true) { return Err(Box::new(e)); } @@ -193,10 +193,7 @@ impl KeyValueDatabaseEngine for Arc { "Created database backup #{} using {} bytes in {} files", info.backup_id, info.size, info.num_files, ); - Ok(()) - } else { - Ok(()) - }; + } if self.config.database_backups_to_keep >= 0 { let keep = u32::try_from(self.config.database_backups_to_keep)?; @@ -205,7 +202,7 @@ impl KeyValueDatabaseEngine for Arc { } } - ret + Ok(()) } fn backup_list(&self) -> Result { diff --git a/src/service/admin.rs b/src/service/admin.rs index 19923d0a..63d6d5c6 100644 --- a/src/service/admin.rs +++ b/src/service/admin.rs @@ -529,10 +529,8 @@ impl Service { &room_id, &state_lock, ).await?; - - Ok(()) - } else { - Ok(()) } + + Ok(()) } } diff --git a/src/service/rooms/threads/mod.rs b/src/service/rooms/threads/mod.rs index a7d5c434..6c48e842 100644 --- a/src/service/rooms/threads/mod.rs +++ b/src/service/rooms/threads/mod.rs @@ -91,11 +91,10 @@ impl Service { let mut users = Vec::new(); if let Some(userids) = self.db.get_participants(root_id)? { users.extend_from_slice(&userids); - users.push(pdu.sender.clone()); } else { users.push(root_pdu.sender); - users.push(pdu.sender.clone()); } + users.push(pdu.sender.clone()); self.db.update_participants(root_id, &users) }