Run cargo fmt.

This commit is contained in:
Paul
2021-06-07 16:16:40 +01:00
parent fce92382bf
commit c763a292a7
23 changed files with 118 additions and 120 deletions

View File

@@ -2,8 +2,8 @@ use crate::database::*;
use crate::util::result::{Error, Result};
use futures::StreamExt;
use rocket_contrib::json::JsonValue;
use mongodb::bson::{doc, from_document};
use rocket_contrib::json::JsonValue;
#[get("/<target>/bans")]
pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
@@ -13,7 +13,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
.with_server(&target)
.for_server()
.await?;
if !perm.get_manage_members() {
Err(Error::MissingPermission)?
}
@@ -30,7 +30,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
operation: "find",
with: "server_bans",
})?;
let mut bans = vec![];
while let Some(result) = cursor.next().await {
if let Ok(doc) = result {
@@ -39,6 +39,6 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
}
}
}
Ok(json!(bans))
}