Run cargo fmt.

This commit is contained in:
Paul Makles
2021-01-18 20:26:26 +00:00
parent bd789b6825
commit a1a921bbcb
19 changed files with 141 additions and 142 deletions

View File

@@ -1,7 +1,7 @@
use crate::database::*;
use crate::util::result::{Error, Result};
use mongodb::bson::to_document;
use serde::{Deserialize, Serialize};
use crate::util::result::{Error, Result};
#[derive(Serialize, Deserialize, Debug)]
#[serde(tag = "type")]

View File

@@ -1,5 +1,9 @@
use crate::{database::*, notifications::events::ClientboundNotification, util::result::{Error, Result}};
use mongodb::bson::{DateTime, to_bson};
use crate::{
database::*,
notifications::events::ClientboundNotification,
util::result::{Error, Result},
};
use mongodb::bson::{to_bson, DateTime};
use serde::{Deserialize, Serialize};
/*#[derive(Serialize, Deserialize, Debug)]
@@ -39,13 +43,13 @@ pub struct Message {
impl Message {
pub async fn send(self) -> Result<()> {
get_collection("messages")
.insert_one(
to_bson(&self).unwrap().as_document().unwrap().clone(),
None
)
.insert_one(to_bson(&self).unwrap().as_document().unwrap().clone(), None)
.await
.map_err(|_| Error::DatabaseError { operation: "insert_one", with: "messages" })?;
.map_err(|_| Error::DatabaseError {
operation: "insert_one",
with: "messages",
})?;
let channel = self.channel.clone();
ClientboundNotification::Message(self)
.publish(channel)