mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-16 20:57:53 +08:00
define SendmailConfig once
Reasons: - Makes the declaration more concicse. - Avoids the mutation. Signed-off-by: Perma Alesheikh <me@prma.dev>
This commit is contained in:
committed by
Clément DOUIN
parent
6fcdf7ea10
commit
8016ecb5a0
@@ -5,13 +5,14 @@ use email::sendmail::config::SendmailConfig;
|
||||
use crate::{backend::config::BackendConfig, ui::THEME};
|
||||
|
||||
pub(crate) fn configure() -> Result<BackendConfig> {
|
||||
let mut config = SendmailConfig::default();
|
||||
|
||||
config.cmd = Input::with_theme(&*THEME)
|
||||
.with_prompt("Sendmail-compatible shell command to send emails")
|
||||
.default(String::from("/usr/bin/msmtp"))
|
||||
.interact()?
|
||||
.into();
|
||||
let config = SendmailConfig {
|
||||
cmd: Input::with_theme(&*THEME)
|
||||
.with_prompt("Sendmail-compatible shell command to send emails")
|
||||
.default(String::from("/usr/bin/msmtp"))
|
||||
.interact()?
|
||||
.into(),
|
||||
// ..Default::default() // in case any other field was added
|
||||
};
|
||||
|
||||
Ok(BackendConfig::Sendmail(config))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user