clean both flake and non-flake API

This commit is contained in:
Clément DOUIN
2024-11-27 10:04:12 +01:00
parent 7806de626e
commit 6dc448b062
11 changed files with 154 additions and 302 deletions
+9 -3
View File
@@ -4,7 +4,13 @@ use color_eyre::Result;
use email::imap::config::ImapAuthConfig;
#[cfg(feature = "smtp")]
use email::smtp::config::SmtpAuthConfig;
#[cfg(any(feature = "imap", feature = "smtp", feature = "pgp"))]
#[cfg(any(
feature = "imap",
feature = "smtp",
feature = "pgp-gpg",
feature = "pgp-commands",
feature = "pgp-native",
))]
use pimalaya_tui::terminal::prompt;
use pimalaya_tui::terminal::{cli::printer::Printer, config::TomlConfig as _};
use tracing::info;
@@ -69,7 +75,7 @@ impl AccountConfigureCommand {
}
}
#[cfg(feature = "pgp")]
#[cfg(any(feature = "pgp-gpg", feature = "pgp-commands", feature = "pgp-native"))]
if let Some(config) = &toml_account_config.pgp {
config.reset().await?;
}
@@ -107,7 +113,7 @@ impl AccountConfigureCommand {
_ => Ok(()),
}?;
#[cfg(feature = "pgp")]
#[cfg(any(feature = "pgp-gpg", feature = "pgp-commands", feature = "pgp-native"))]
if let Some(config) = &toml_account_config.pgp {
config
.configure(&toml_account_config.email, || {
+1 -1
View File
@@ -78,7 +78,7 @@ impl TemplateSaveCommand {
#[allow(unused_mut)]
let mut compiler = MmlCompilerBuilder::new();
#[cfg(feature = "pgp")]
#[cfg(any(feature = "pgp-gpg", feature = "pgp-commands", feature = "pgp-native"))]
compiler.set_some_pgp(account_config.pgp.clone());
let msg = compiler.build(tpl.as_str())?.compile().await?.into_vec()?;
+1 -1
View File
@@ -71,7 +71,7 @@ impl TemplateSendCommand {
#[allow(unused_mut)]
let mut compiler = MmlCompilerBuilder::new();
#[cfg(feature = "pgp")]
#[cfg(any(feature = "pgp-gpg", feature = "pgp-commands", feature = "pgp-native"))]
compiler.set_some_pgp(account_config.pgp.clone());
let msg = compiler.build(tpl.as_str())?.compile().await?.into_vec()?;