mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
chore: Clippy fixes
This commit is contained in:
@@ -4,7 +4,7 @@ use askama::{Template, filters::HtmlSafe};
|
||||
use base64::Engine;
|
||||
use conduwuit_core::{result::FlatOk, utils};
|
||||
use conduwuit_service::{Services, media::mxc::Mxc, oauth::client_metadata::ClientMetadata};
|
||||
use ruma::{MilliSecondsSinceUnixEpoch, OwnedDeviceId, OwnedUserId, UserId};
|
||||
use ruma::{OwnedDeviceId, OwnedUserId, UserId};
|
||||
|
||||
pub(super) mod form;
|
||||
|
||||
@@ -24,10 +24,10 @@ impl HtmlSafe for Avatar {}
|
||||
|
||||
impl Avatar {
|
||||
pub(super) async fn for_local_user(services: &Services, user_id: &UserId) -> Self {
|
||||
let display_name = services.users.displayname(&user_id).await.ok();
|
||||
let display_name = services.users.displayname(user_id).await.ok();
|
||||
|
||||
let avatar_src = async {
|
||||
let avatar_url = services.users.avatar_url(&user_id).await.ok()?;
|
||||
let avatar_url = services.users.avatar_url(user_id).await.ok()?;
|
||||
let (server_name, media_id) = avatar_url.parts().ok()?;
|
||||
let file = services
|
||||
.media
|
||||
@@ -57,7 +57,7 @@ impl Avatar {
|
||||
AvatarType::Initial(user_id.localpart().chars().next().unwrap())
|
||||
};
|
||||
|
||||
Avatar { avatar_type }
|
||||
Self { avatar_type }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ macro_rules! template {
|
||||
}
|
||||
|
||||
impl$(<$lifetime>)? $name$(<$lifetime>)? {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn new(state: &$crate::State, $($field_name: $field_type,)*) -> Self {
|
||||
Self {
|
||||
context: state.into(),
|
||||
|
||||
@@ -3,18 +3,11 @@ use std::collections::BTreeSet;
|
||||
use axum::{
|
||||
Router,
|
||||
extract::{Query, State},
|
||||
response::{IntoResponse, Redirect},
|
||||
response::Redirect,
|
||||
routing::on,
|
||||
};
|
||||
use conduwuit_service::{
|
||||
oauth::{
|
||||
client_metadata::{self, ClientMetadata},
|
||||
grant::{AuthorizationCodeQuery, Scope},
|
||||
},
|
||||
rooms::user,
|
||||
};
|
||||
use ruma::{OwnedDeviceId, OwnedUserId};
|
||||
use serde::Deserialize;
|
||||
use conduwuit_service::oauth::grant::{AuthorizationCodeQuery, Scope};
|
||||
use ruma::OwnedUserId;
|
||||
use url::Url;
|
||||
|
||||
use crate::{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::HashMap,
|
||||
mem::discriminant,
|
||||
time::{Duration, SystemTime},
|
||||
};
|
||||
@@ -8,7 +7,7 @@ use std::{
|
||||
use axum::{extract::FromRequestParts, http::request::Parts};
|
||||
use conduwuit_service::oauth::grant::AuthorizationCodeQuery;
|
||||
use ruma::{OwnedUserId, UserId};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tower_sessions::Session;
|
||||
|
||||
use crate::{ROUTE_PREFIX, WebError};
|
||||
|
||||
Reference in New Issue
Block a user