fix cargo features

This commit is contained in:
Clément DOUIN
2024-08-09 12:03:23 +02:00
parent f9b92e6e7a
commit d26314cd48
52 changed files with 1205 additions and 2762 deletions
+3 -11
View File
@@ -3,8 +3,6 @@ use color_eyre::Result;
use email::{backend::feature::BackendFeatureSource, folder::add::AddFolder};
use tracing::info;
#[cfg(feature = "account-sync")]
use crate::cache::arg::disable::CacheDisableFlag;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
folder::arg::name::FolderNameArg, printer::Printer,
@@ -19,10 +17,6 @@ pub struct AddFolderCommand {
#[command(flatten)]
pub folder: FolderNameArg,
#[cfg(feature = "account-sync")]
#[command(flatten)]
pub cache: CacheDisableFlag,
#[command(flatten)]
pub account: AccountNameFlag,
}
@@ -32,11 +26,9 @@ impl AddFolderCommand {
info!("executing create folder command");
let folder = &self.folder.name;
let (toml_account_config, account_config) = config.clone().into_account_configs(
self.account.name.as_deref(),
#[cfg(feature = "account-sync")]
self.cache.disable,
)?;
let (toml_account_config, account_config) = config
.clone()
.into_account_configs(self.account.name.as_deref())?;
let add_folder_kind = toml_account_config.add_folder_kind();
+3 -11
View File
@@ -5,8 +5,6 @@ use inquire::Confirm;
use std::process;
use tracing::info;
#[cfg(feature = "account-sync")]
use crate::cache::arg::disable::CacheDisableFlag;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
folder::arg::name::FolderNameArg, printer::Printer,
@@ -21,10 +19,6 @@ pub struct FolderDeleteCommand {
#[command(flatten)]
pub folder: FolderNameArg,
#[cfg(feature = "account-sync")]
#[command(flatten)]
pub cache: CacheDisableFlag,
#[command(flatten)]
pub account: AccountNameFlag,
}
@@ -42,11 +36,9 @@ impl FolderDeleteCommand {
process::exit(0);
};
let (toml_account_config, account_config) = config.clone().into_account_configs(
self.account.name.as_deref(),
#[cfg(feature = "account-sync")]
self.cache.disable,
)?;
let (toml_account_config, account_config) = config
.clone()
.into_account_configs(self.account.name.as_deref())?;
let delete_folder_kind = toml_account_config.delete_folder_kind();
+3 -11
View File
@@ -3,8 +3,6 @@ use color_eyre::Result;
use email::{backend::feature::BackendFeatureSource, folder::expunge::ExpungeFolder};
use tracing::info;
#[cfg(feature = "account-sync")]
use crate::cache::arg::disable::CacheDisableFlag;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
folder::arg::name::FolderNameArg, printer::Printer,
@@ -20,10 +18,6 @@ pub struct FolderExpungeCommand {
#[command(flatten)]
pub folder: FolderNameArg,
#[cfg(feature = "account-sync")]
#[command(flatten)]
pub cache: CacheDisableFlag,
#[command(flatten)]
pub account: AccountNameFlag,
}
@@ -33,11 +27,9 @@ impl FolderExpungeCommand {
info!("executing expunge folder command");
let folder = &self.folder.name;
let (toml_account_config, account_config) = config.clone().into_account_configs(
self.account.name.as_deref(),
#[cfg(feature = "account-sync")]
self.cache.disable,
)?;
let (toml_account_config, account_config) = config
.clone()
.into_account_configs(self.account.name.as_deref())?;
let expunge_folder_kind = toml_account_config.expunge_folder_kind();
+3 -11
View File
@@ -3,8 +3,6 @@ use color_eyre::Result;
use email::{backend::feature::BackendFeatureSource, folder::list::ListFolders};
use tracing::info;
#[cfg(feature = "account-sync")]
use crate::cache::arg::disable::CacheDisableFlag;
use crate::{
account::arg::name::AccountNameFlag,
backend::Backend,
@@ -18,10 +16,6 @@ use crate::{
/// This command allows you to list all exsting folders.
#[derive(Debug, Parser)]
pub struct FolderListCommand {
#[cfg(feature = "account-sync")]
#[command(flatten)]
pub cache: CacheDisableFlag,
#[command(flatten)]
pub account: AccountNameFlag,
@@ -38,11 +32,9 @@ impl FolderListCommand {
pub async fn execute(self, printer: &mut impl Printer, config: &TomlConfig) -> Result<()> {
info!("executing list folders command");
let (toml_account_config, account_config) = config.clone().into_account_configs(
self.account.name.as_deref(),
#[cfg(feature = "account-sync")]
self.cache.disable,
)?;
let (toml_account_config, account_config) = config
.clone()
.into_account_configs(self.account.name.as_deref())?;
let list_folders_kind = toml_account_config.list_folders_kind();
+3 -11
View File
@@ -4,8 +4,6 @@ use email::{backend::feature::BackendFeatureSource, folder::purge::PurgeFolder};
use std::process;
use tracing::info;
#[cfg(feature = "account-sync")]
use crate::cache::arg::disable::CacheDisableFlag;
use crate::{
account::arg::name::AccountNameFlag, backend::Backend, config::TomlConfig,
folder::arg::name::FolderNameArg, printer::Printer,
@@ -20,10 +18,6 @@ pub struct FolderPurgeCommand {
#[command(flatten)]
pub folder: FolderNameArg,
#[cfg(feature = "account-sync")]
#[command(flatten)]
pub cache: CacheDisableFlag,
#[command(flatten)]
pub account: AccountNameFlag,
}
@@ -42,11 +36,9 @@ impl FolderPurgeCommand {
process::exit(0);
};
let (toml_account_config, account_config) = config.clone().into_account_configs(
self.account.name.as_deref(),
#[cfg(feature = "account-sync")]
self.cache.disable,
)?;
let (toml_account_config, account_config) = config
.clone()
.into_account_configs(self.account.name.as_deref())?;
let purge_folder_kind = toml_account_config.purge_folder_kind();
-4
View File
@@ -1,5 +1,3 @@
#[cfg(feature = "account-sync")]
use email::folder::sync::config::FolderSyncConfig;
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};
@@ -14,8 +12,6 @@ pub struct FolderConfig {
pub expunge: Option<FolderExpungeConfig>,
pub purge: Option<FolderPurgeConfig>,
pub delete: Option<FolderDeleteConfig>,
#[cfg(feature = "account-sync")]
pub sync: Option<FolderSyncConfig>,
}
impl FolderConfig {