mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-05 17:15:12 +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};
|
use crate::{backend::config::BackendConfig, ui::THEME};
|
||||||
|
|
||||||
pub(crate) fn configure() -> Result<BackendConfig> {
|
pub(crate) fn configure() -> Result<BackendConfig> {
|
||||||
let mut config = SendmailConfig::default();
|
let config = SendmailConfig {
|
||||||
|
cmd: Input::with_theme(&*THEME)
|
||||||
config.cmd = Input::with_theme(&*THEME)
|
.with_prompt("Sendmail-compatible shell command to send emails")
|
||||||
.with_prompt("Sendmail-compatible shell command to send emails")
|
.default(String::from("/usr/bin/msmtp"))
|
||||||
.default(String::from("/usr/bin/msmtp"))
|
.interact()?
|
||||||
.interact()?
|
.into(),
|
||||||
.into();
|
// ..Default::default() // in case any other field was added
|
||||||
|
};
|
||||||
|
|
||||||
Ok(BackendConfig::Sendmail(config))
|
Ok(BackendConfig::Sendmail(config))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue