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

@@ -1,10 +1,10 @@
use crate::database::*;
use crate::util::result::{Error, Result};
use rocket_contrib::json::JsonValue;
use serde::{Serialize, Deserialize};
use mongodb::bson::{doc, from_document};
use futures::StreamExt;
use mongodb::bson::{doc, from_document};
use rocket_contrib::json::JsonValue;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ServerInvite {
@@ -22,7 +22,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
.with_server(&target)
.for_server()
.await?;
if !perm.get_manage_server() {
Err(Error::MissingPermission)?
}
@@ -39,7 +39,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
operation: "find",
with: "invites",
})?;
let mut invites = vec![];
while let Some(result) = cursor.next().await {
if let Ok(doc) = result {
@@ -48,6 +48,6 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
}
}
}
Ok(json!(invites))
}