refactor: clean up clippy warnings

This commit is contained in:
izzy
2025-06-07 17:50:11 +01:00
parent 911ffc767e
commit 8cc4bbea4d
22 changed files with 37 additions and 47 deletions

View File

@@ -181,7 +181,7 @@ impl Server {
}
/// Update server data
pub async fn update<'a>(
pub async fn update(
&mut self,
db: &Database,
partial: PartialServer,

View File

@@ -7,11 +7,5 @@ mod rocket;
#[cfg(feature = "rocket-impl")]
mod schema;
#[cfg(feature = "axum-impl")]
pub use self::axum::*;
#[cfg(feature = "rocket-impl")]
pub use self::rocket::*;
#[cfg(feature = "rocket-impl")]
pub use self::schema::*;
pub use model::*;
pub use ops::*;

View File

@@ -1,7 +1,7 @@
use ::mongodb::options::{Collation, CollationStrength, FindOneOptions, FindOptions};
use authifier::models::Session;
use futures::StreamExt;
use iso8601_timestamp::{typenum as t, Timestamp, UtcOffset};
use iso8601_timestamp::Timestamp;
use revolt_result::Result;
use crate::DocumentId;

View File

@@ -4,7 +4,7 @@ use once_cell::sync::Lazy;
use crate::events::client::EventV1;
static Q: Lazy<(Sender<AuthifierEvent>, Receiver<AuthifierEvent>)> = Lazy::new(|| unbounded());
static Q: Lazy<(Sender<AuthifierEvent>, Receiver<AuthifierEvent>)> = Lazy::new(unbounded);
/// Get sender
pub fn sender() -> Sender<AuthifierEvent> {

View File

@@ -15,8 +15,7 @@ impl crate::Bot {
avatar: user.avatar.map(|x| x.id).unwrap_or_default(),
description: user
.profile
.map(|profile| profile.content)
.flatten()
.and_then(|profile| profile.content)
.unwrap_or_default(),
}
}
@@ -1114,7 +1113,7 @@ impl crate::User {
}
/// Convert user object into user model without presence information
pub async fn into_known_static<'a>(self, is_online: bool) -> User {
pub async fn into_known_static(self, is_online: bool) -> User {
let badges = self.get_badges().await;
User {

View File

@@ -54,7 +54,7 @@ use revolt_rocket_okapi::{
use schemars::schema::{InstanceType, SchemaObject, SingleOrVec};
#[cfg(feature = "rocket-impl")]
impl<'r> OpenApiFromRequest<'r> for IdempotencyKey {
impl OpenApiFromRequest<'_> for IdempotencyKey {
fn from_request_input(
_gen: &mut OpenApiGenerator,
_name: String,

View File

@@ -104,7 +104,7 @@ impl PermissionQuery for DatabasePermissionQuery<'_> {
.unwrap_or_default();
self.cached_mutual_connection = Some(value);
matches!(value, true)
value
} else {
false
}