fix: Load bearing mut refs

This commit is contained in:
timedout
2026-06-27 18:37:33 +01:00
parent e4922814b9
commit 2d65d47498
3 changed files with 7 additions and 10 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
use std::{borrow::Cow, fmt::Debug, mem, time::Instant};
use bytes::BytesMut;
use conduwuit::{Err, Result, debug_info, err, utils, utils::response::LimitReadExt, warn};
use conduwuit::{Err, Result, debug_info, err, utils::response::LimitReadExt};
use reqwest::Client;
use ruma::api::{
IncomingResponse, OutgoingRequest,
-2
View File
@@ -53,7 +53,6 @@ pub struct Service {
struct Services {
client: Dep<client::Service>,
globals: Dep<globals::Service>,
state: Dep<rooms::state::Service>,
state_cache: Dep<rooms::state_cache::Service>,
user: Dep<rooms::user::Service>,
users: Dep<users::Service>,
@@ -97,7 +96,6 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
services: Services {
client: args.depend::<client::Service>("client"),
globals: args.depend::<globals::Service>("globals"),
state: args.depend::<rooms::state::Service>("rooms::state"),
state_cache: args.depend::<rooms::state_cache::Service>("rooms::state_cache"),
user: args.depend::<rooms::user::Service>("rooms::user"),
users: args.depend::<users::Service>("users"),
+6 -7
View File
@@ -1,7 +1,6 @@
use std::{
collections::{BTreeMap, HashMap, HashSet},
fmt::Debug,
future::ready,
sync::{
Arc,
atomic::{AtomicU64, AtomicUsize, Ordering},
@@ -11,13 +10,11 @@
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
use conduwuit::{
debug_error, debug_info, debug_warn, info,
utils::time::exponential_backoff::min_exp_backoff_duration,
debug_info, debug_warn, info, utils::time::exponential_backoff::min_exp_backoff_duration,
};
use conduwuit_core::{
Error, Event, Result, at, debug, err, error,
result::LogErr,
trace,
utils::{
ReadyExt, calculate_hash, continue_exponential_backoff_secs,
future::TryExtExt,
@@ -33,7 +30,7 @@
};
use ruma::{
CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedRoomId, OwnedServerName, OwnedUserId,
RoomId, RoomVersionId, ServerName, UInt,
RoomId, ServerName, UInt,
api::{
appservice::event::push_events::v1::EphemeralData,
federation::transactions::{
@@ -164,10 +161,11 @@ fn handle_response_err(dest: Destination, statuses: &mut CurTransactionStatus, e
}
/// Handles a successful response, queueing up more sends if necessary.
#[allow(clippy::needless_pass_by_ref_mut)]
async fn handle_response_ok<'a>(
&'a self,
dest: &Destination,
futures: &SendingFutures<'a>,
futures: &mut SendingFutures<'a>,
statuses: &mut CurTransactionStatus,
) {
let _cork = self.db.db.cork();
@@ -196,10 +194,11 @@ async fn handle_response_ok<'a>(
/// no new events to send the destination, it is removed from the status map
/// instead.
#[tracing::instrument(name = "request", level = "debug", skip_all)]
#[allow(clippy::needless_pass_by_ref_mut)]
async fn handle_request<'a>(
&'a self,
msg: Msg,
futures: &SendingFutures<'a>,
futures: &mut SendingFutures<'a>,
statuses: &mut CurTransactionStatus,
) {
let iv = vec![(msg.queue_id, msg.event)];