forked from jmug/stoatchat
Run cargo fmt.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user