aboutsummaryrefslogtreecommitdiff
path: root/src/mail/mailbox.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail/mailbox.rs')
-rw-r--r--src/mail/mailbox.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs
index 44ffe20..df7ede9 100644
--- a/src/mail/mailbox.rs
+++ b/src/mail/mailbox.rs
@@ -138,7 +138,7 @@ impl Mailbox {
/// Copy an email from an other Mailbox to this mailbox
/// (use this when possible, as it allows for a certain number of storage optimizations)
- pub async fn copy_from(&self, from: &Mailbox, uuid: UniqueIdent) -> Result<()> {
+ pub async fn copy_from(&self, from: &Mailbox, uuid: UniqueIdent) -> Result<UniqueIdent> {
if self.id == from.id {
bail!("Cannot copy into same mailbox");
}
@@ -412,9 +412,14 @@ impl MailboxInternal {
Ok(())
}
- async fn copy_from(&mut self, from: &MailboxInternal, source_id: UniqueIdent) -> Result<()> {
+ async fn copy_from(
+ &mut self,
+ from: &MailboxInternal,
+ source_id: UniqueIdent,
+ ) -> Result<UniqueIdent> {
let new_id = gen_ident();
- self.copy_internal(from, source_id, new_id).await
+ self.copy_internal(from, source_id, new_id).await?;
+ Ok(new_id)
}
async fn move_from(&mut self, from: &mut MailboxInternal, id: UniqueIdent) -> Result<()> {