refactor(core/database): AbstractAttachment -> AbstractAttachments

This commit is contained in:
Paul Makles committed 2023-04-26 16:51:52 +01:00
1 parent 60ebdb64d7
commit e33ae17061
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ mod mongodb;
mod reference;
#[async_trait]
pub trait AbstractAttachment: Sync + Send {
pub trait AbstractAttachments: Sync + Send {
/// Insert attachment into database.
async fn insert_attachment(&self, attachment: &File) -> Result<()>;
@@ -4,12 +4,12 @@ use revolt_result::Result;
use crate::File;
use crate::MongoDb;
use super::AbstractAttachment;
use super::AbstractAttachments;
static COL: &str = "bots";
#[async_trait]
impl AbstractAttachment for MongoDb {
impl AbstractAttachments for MongoDb {
/// Insert attachment into database.
async fn insert_attachment(&self, attachment: &File) -> Result<()> {
query!(self, insert_one, COL, &attachment).map(|_| ())
@@ -3,10 +3,10 @@ use revolt_result::Result;
use crate::File;
use crate::ReferenceDb;
use super::AbstractAttachment;
use super::AbstractAttachments;
#[async_trait]
impl AbstractAttachment for ReferenceDb {
impl AbstractAttachments for ReferenceDb {
/// Insert attachment into database.
async fn insert_attachment(&self, attachment: &File) -> Result<()> {
let mut attachments = self.files.lock().await;
+1 -1
View File
@@ -15,7 +15,7 @@ pub trait AbstractDatabase:
+ Send
+ admin_migrations::AbstractMigrations
+ bots::AbstractBots
+ files::AbstractAttachment
+ files::AbstractAttachments
+ users::AbstractUsers
{
}