Skip to content

email: Remove obsolete Arc around FileTransport #7887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/email.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use crate::config;
use crate::Env;
use lettre::address::Envelope;
Expand Down Expand Up @@ -48,7 +46,7 @@ impl Emails {
}
_ => {
let transport = FileTransport::new("/tmp");
EmailBackend::FileSystem(Arc::new(transport))
EmailBackend::FileSystem(transport)
}
};

Expand Down Expand Up @@ -127,9 +125,11 @@ pub enum EmailError {
#[derive(Clone)]
enum EmailBackend {
/// Backend used in production to send mails using SMTP.
///
/// This is using `Box` to avoid a large size difference between variants.
Smtp(Box<SmtpTransport>),
/// Backend used locally during development, will store the emails in the provided directory.
FileSystem(Arc<FileTransport>),
FileSystem(FileTransport),
/// Backend used during tests, will keep messages in memory to allow tests to retrieve them.
Memory(StubTransport),
}
Expand Down