run cargo fix for rust 2024 changes and rustfmt

Signed-off-by: June Clementine Strawberry <strawberry@puppygock.gay>
This commit is contained in:
June Clementine Strawberry 2025-02-23 01:17:45 -05:00
parent e97952b7f6
commit a1e1f40ded
No known key found for this signature in database
320 changed files with 2212 additions and 2039 deletions

View file

@ -2,15 +2,15 @@ use std::{mem, ops::Deref};
use axum::{async_trait, body::Body, extract::FromRequest};
use bytes::{BufMut, Bytes, BytesMut};
use conduwuit::{debug, debug_warn, err, trace, utils::string::EMPTY, Error, Result};
use conduwuit::{Error, Result, debug, debug_warn, err, trace, utils::string::EMPTY};
use ruma::{
api::IncomingRequest, CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId,
OwnedServerName, OwnedUserId, ServerName, UserId,
CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId, OwnedServerName,
OwnedUserId, ServerName, UserId, api::IncomingRequest,
};
use service::Services;
use super::{auth, auth::Auth, request, request::Request};
use crate::{service::appservice::RegistrationInfo, State};
use crate::{State, service::appservice::RegistrationInfo};
/// Extractor for Ruma request structs
pub(crate) struct Args<T> {

View file

@ -1,12 +1,14 @@
use axum::RequestPartsExt;
use axum_extra::{
headers::{authorization::Bearer, Authorization},
typed_header::TypedHeaderRejectionReason,
TypedHeader,
headers::{Authorization, authorization::Bearer},
typed_header::TypedHeaderRejectionReason,
};
use conduwuit::{debug_error, err, warn, Err, Error, Result};
use conduwuit::{Err, Error, Result, debug_error, err, warn};
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId,
api::{
AuthScheme, IncomingRequest, Metadata,
client::{
directory::get_public_rooms,
error::ErrorKind,
@ -16,14 +18,12 @@ use ruma::{
voip::get_turn_server_info,
},
federation::openid::get_openid_userinfo,
AuthScheme, IncomingRequest, Metadata,
},
server_util::authorization::XMatrix,
CanonicalJsonObject, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId,
};
use service::{
server_keys::{PubKeyMap, PubKeys},
Services,
server_keys::{PubKeyMap, PubKeys},
};
use super::request::Request;
@ -56,12 +56,12 @@ pub(super) async fn auth(
};
let token = if let Some(token) = token {
if let Some(reg_info) = services.appservice.find_from_token(token).await {
Token::Appservice(Box::new(reg_info))
} else if let Ok((user_id, device_id)) = services.users.find_from_token(token).await {
Token::User((user_id, device_id))
} else {
Token::Invalid
match services.appservice.find_from_token(token).await {
| Some(reg_info) => Token::Appservice(Box::new(reg_info)),
| _ => match services.users.find_from_token(token).await {
| Ok((user_id, device_id)) => Token::User((user_id, device_id)),
| _ => Token::Invalid,
},
}
} else {
Token::None

View file

@ -1,8 +1,8 @@
use axum::{
Router,
extract::FromRequestParts,
response::IntoResponse,
routing::{on, MethodFilter},
Router,
routing::{MethodFilter, on},
};
use conduwuit::Result;
use futures::{Future, TryFutureExt};

View file

@ -1,8 +1,8 @@
use std::str;
use axum::{extract::Path, RequestExt, RequestPartsExt};
use axum::{RequestExt, RequestPartsExt, extract::Path};
use bytes::Bytes;
use conduwuit::{err, Result};
use conduwuit::{Result, err};
use http::request::Parts;
use serde::Deserialize;
use service::Services;

View file

@ -1,9 +1,9 @@
use axum::response::{IntoResponse, Response};
use bytes::BytesMut;
use conduwuit::{error, Error};
use conduwuit::{Error, error};
use http::StatusCode;
use http_body_util::Full;
use ruma::api::{client::uiaa::UiaaResponse, OutgoingResponse};
use ruma::api::{OutgoingResponse, client::uiaa::UiaaResponse};
pub(crate) struct RumaResponse<T>(pub(crate) T)
where