mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-03 07:55:13 +00: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:
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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue