style: cargo clippy --fix && cargo fmt
This commit is contained in:
parent
0e0c590e4d
commit
b28d5b840f
3 changed files with 9 additions and 4 deletions
|
@ -45,7 +45,9 @@ pub async fn unban(
|
||||||
let mut conn = app_state.pool.get().await?;
|
let mut conn = app_state.pool.get().await?;
|
||||||
|
|
||||||
let caller = Member::check_membership(&mut conn, uuid, guild_uuid).await?;
|
let caller = Member::check_membership(&mut conn, uuid, guild_uuid).await?;
|
||||||
caller.check_permission(&app_state, Permissions::BanMember).await?;
|
caller
|
||||||
|
.check_permission(&app_state, Permissions::BanMember)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let ban = GuildBan::fetch_one(&mut conn, guild_uuid, user_uuid).await?;
|
let ban = GuildBan::fetch_one(&mut conn, guild_uuid, user_uuid).await?;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use axum::{
|
||||||
extract::{Multipart, Path, State},
|
extract::{Multipart, Path, State},
|
||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
routing::{get, patch, post, delete},
|
routing::{delete, get, patch, post},
|
||||||
};
|
};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
|
@ -6,7 +6,10 @@ use serde::{Deserialize, Serialize};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Error, objects::{GuildBan, Me, Permissions, Role}, schema::{guild_bans, guild_members}, AppState, Conn
|
AppState, Conn,
|
||||||
|
error::Error,
|
||||||
|
objects::{GuildBan, Me, Permissions, Role},
|
||||||
|
schema::{guild_bans, guild_members},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{User, load_or_empty};
|
use super::{User, load_or_empty};
|
||||||
|
@ -169,7 +172,7 @@ impl Member {
|
||||||
match banned {
|
match banned {
|
||||||
Ok(_) => Err(Error::Forbidden("User banned".to_string())),
|
Ok(_) => Err(Error::Forbidden("User banned".to_string())),
|
||||||
Err(Error::SqlError(diesel::result::Error::NotFound)) => Ok(()),
|
Err(Error::SqlError(diesel::result::Error::NotFound)) => Ok(()),
|
||||||
Err(e) => Err(e.into()),
|
Err(e) => Err(e),
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
let member_uuid = Uuid::now_v7();
|
let member_uuid = Uuid::now_v7();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue