Skip to content

Commit c921fd3

Browse files
authored
email: Remove obsolete Arc around FileTransport (#7887)
`FileTransport` implements `Clone` now, so the `Arc` isn't needed anymore.
1 parent 62165a4 commit c921fd3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/email.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::sync::Arc;
2-
31
use crate::config;
42
use crate::Env;
53
use lettre::address::Envelope;
@@ -48,7 +46,7 @@ impl Emails {
4846
}
4947
_ => {
5048
let transport = FileTransport::new("/tmp");
51-
EmailBackend::FileSystem(Arc::new(transport))
49+
EmailBackend::FileSystem(transport)
5250
}
5351
};
5452

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

0 commit comments

Comments
 (0)