refactor: remove inspect_err debug code

This commit is contained in:
Paul Makles
2024-07-28 17:33:51 +01:00
parent 5ce7530206
commit b8fdc07508

View File

@@ -5,7 +5,8 @@ use revolt_models::v0::MessageSort;
use revolt_result::Result; use revolt_result::Result;
use crate::{ use crate::{
AppendMessage, DocumentId, FieldsMessage, IntoDocumentPath, Message, MessageQuery, MessageTimePeriod, MongoDb, PartialMessage AppendMessage, DocumentId, FieldsMessage, IntoDocumentPath, Message, MessageQuery,
MessageTimePeriod, MongoDb, PartialMessage,
}; };
use super::AbstractMessages; use super::AbstractMessages;
@@ -181,7 +182,12 @@ impl AbstractMessages for MongoDb {
} }
/// Update a given message with new information /// Update a given message with new information
async fn update_message(&self, id: &str, message: &PartialMessage, remove: Vec<FieldsMessage>) -> Result<()> { async fn update_message(
&self,
id: &str,
message: &PartialMessage,
remove: Vec<FieldsMessage>,
) -> Result<()> {
query!( query!(
self, self,
update_one_by_id, update_one_by_id,
@@ -190,7 +196,8 @@ impl AbstractMessages for MongoDb {
message, message,
remove.iter().map(|x| x as &dyn IntoDocumentPath).collect(), remove.iter().map(|x| x as &dyn IntoDocumentPath).collect(),
None None
).map(|_| ()) )
.map(|_| ())
} }
/// Append information to a given message /// Append information to a given message
@@ -311,7 +318,7 @@ impl AbstractMessages for MongoDb {
impl IntoDocumentPath for FieldsMessage { impl IntoDocumentPath for FieldsMessage {
fn as_path(&self) -> Option<&'static str> { fn as_path(&self) -> Option<&'static str> {
Some(match self { Some(match self {
FieldsMessage::Pinned => "pinned" FieldsMessage::Pinned => "pinned",
}) })
} }
} }