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