enable multiple_bound_locations lint

This commit is contained in:
Charles Hall 2024-05-21 22:09:21 -07:00
parent 92d9f81a78
commit eaeb7620d9
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
5 changed files with 10 additions and 11 deletions

View file

@ -72,7 +72,6 @@ wildcard_dependencies = "warn"
missing_errors_doc = "allow" missing_errors_doc = "allow"
missing_panics_doc = "allow" missing_panics_doc = "allow"
multiple_bound_locations = "allow"
option_as_ref_cloned = "allow" option_as_ref_cloned = "allow"
thread_local_initializer_can_be_made_const = "allow" thread_local_initializer_can_be_made_const = "allow"
unnecessary_to_owned = "allow" unnecessary_to_owned = "allow"

View file

@ -14,12 +14,12 @@ use crate::{services, utils, Error, Result};
/// Only returns None if there is no url specified in the appservice /// Only returns None if there is no url specified in the appservice
/// registration file /// registration file
#[tracing::instrument(skip(request))] #[tracing::instrument(skip(request))]
pub(crate) async fn send_request<T: OutgoingRequest>( pub(crate) async fn send_request<T>(
registration: Registration, registration: Registration,
request: T, request: T,
) -> Result<Option<T::IncomingResponse>> ) -> Result<Option<T::IncomingResponse>>
where where
T: Debug, T: OutgoingRequest + Debug,
{ {
let Some(destination) = registration.url else { let Some(destination) = registration.url else {
return Ok(None); return Ok(None);

View file

@ -128,12 +128,12 @@ impl FedDest {
} }
#[tracing::instrument(skip(request), fields(destination_cache_result))] #[tracing::instrument(skip(request), fields(destination_cache_result))]
pub(crate) async fn send_request<T: OutgoingRequest>( pub(crate) async fn send_request<T>(
destination: &ServerName, destination: &ServerName,
request: T, request: T,
) -> Result<T::IncomingResponse> ) -> Result<T::IncomingResponse>
where where
T: Debug, T: OutgoingRequest + Debug,
{ {
if !services().globals.allow_federation() { if !services().globals.allow_federation() {
return Err(Error::BadConfig("Federation is disabled.")); return Err(Error::BadConfig("Federation is disabled."));

View file

@ -62,13 +62,13 @@ impl Service {
} }
#[tracing::instrument(skip(self, destination, request))] #[tracing::instrument(skip(self, destination, request))]
pub(crate) async fn send_request<T: OutgoingRequest>( pub(crate) async fn send_request<T>(
&self, &self,
destination: &str, destination: &str,
request: T, request: T,
) -> Result<T::IncomingResponse> ) -> Result<T::IncomingResponse>
where where
T: Debug, T: OutgoingRequest + Debug,
{ {
let destination = destination.replace("/_matrix/push/v1/notify", ""); let destination = destination.replace("/_matrix/push/v1/notify", "");

View file

@ -867,13 +867,13 @@ impl Service {
} }
#[tracing::instrument(skip(self, request))] #[tracing::instrument(skip(self, request))]
pub(crate) async fn send_federation_request<T: OutgoingRequest>( pub(crate) async fn send_federation_request<T>(
&self, &self,
destination: &ServerName, destination: &ServerName,
request: T, request: T,
) -> Result<T::IncomingResponse> ) -> Result<T::IncomingResponse>
where where
T: Debug, T: OutgoingRequest + Debug,
{ {
debug!("Waiting for permit"); debug!("Waiting for permit");
let permit = self.maximum_requests.acquire().await; let permit = self.maximum_requests.acquire().await;
@ -900,13 +900,13 @@ impl Service {
skip(self, registration, request), skip(self, registration, request),
fields(appservice_id = registration.id), fields(appservice_id = registration.id),
)] )]
pub(crate) async fn send_appservice_request<T: OutgoingRequest>( pub(crate) async fn send_appservice_request<T>(
&self, &self,
registration: Registration, registration: Registration,
request: T, request: T,
) -> Result<Option<T::IncomingResponse>> ) -> Result<Option<T::IncomingResponse>>
where where
T: Debug, T: OutgoingRequest + Debug,
{ {
let permit = self.maximum_requests.acquire().await; let permit = self.maximum_requests.acquire().await;
let response = let response =