mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-03 07:55:13 +00:00
use as_deref instead of as_ref for account.name
Reasons: - More concise. - Avoids the need for map(String::str). Signed-off-by: Perma Alesheikh <me@prma.dev>
This commit is contained in:
parent
59fefd7c78
commit
f7a7937cb1
|
@ -71,7 +71,7 @@ impl ListEnvelopesCommand {
|
|||
info!("executing list envelopes command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -41,7 +41,7 @@ impl WatchEnvelopesCommand {
|
|||
|
||||
let folder = &self.folder.name;
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -46,7 +46,7 @@ impl FlagAddCommand {
|
|||
let folder = &self.folder.name;
|
||||
let (ids, flags) = into_tuple(&self.args.ids_and_flags);
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -46,7 +46,7 @@ impl FlagRemoveCommand {
|
|||
let folder = &self.folder.name;
|
||||
let (ids, flags) = into_tuple(&self.args.ids_and_flags);
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -46,7 +46,7 @@ impl FlagSetCommand {
|
|||
let folder = &self.folder.name;
|
||||
let (ids, flags) = into_tuple(&self.args.ids_and_flags);
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -47,7 +47,7 @@ impl AttachmentDownloadCommand {
|
|||
let ids = &self.envelopes.ids;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -47,7 +47,7 @@ impl MessageCopyCommand {
|
|||
let ids = &self.envelopes.ids;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -48,7 +48,7 @@ impl MessageDeleteCommand {
|
|||
let ids = &self.envelopes.ids;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -59,7 +59,7 @@ impl MessageForwardCommand {
|
|||
let folder = &self.folder.name;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -56,7 +56,7 @@ impl MessageMailtoCommand {
|
|||
info!("executing mailto message command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -47,7 +47,7 @@ impl MessageMoveCommand {
|
|||
let ids = &self.envelopes.ids;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -92,7 +92,7 @@ impl MessageReadCommand {
|
|||
let ids = &self.envelopes.ids;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -61,7 +61,7 @@ impl MessageReplyCommand {
|
|||
|
||||
let folder = &self.folder.name;
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -45,7 +45,7 @@ impl MessageSaveCommand {
|
|||
let folder = &self.folder.name;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -44,7 +44,7 @@ impl MessageSendCommand {
|
|||
info!("executing send message command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -50,7 +50,7 @@ impl MessageWriteCommand {
|
|||
info!("executing write message command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -53,7 +53,7 @@ impl TemplateForwardCommand {
|
|||
let folder = &self.folder.name;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -58,7 +58,7 @@ impl TemplateReplyCommand {
|
|||
let id = self.envelope.id;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -49,7 +49,7 @@ impl TemplateSaveCommand {
|
|||
let folder = &self.folder.name;
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -47,7 +47,7 @@ impl TemplateSendCommand {
|
|||
info!("executing send template command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -36,7 +36,7 @@ impl TemplateWriteCommand {
|
|||
info!("executing write template command");
|
||||
|
||||
let (_, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -38,7 +38,7 @@ impl AddFolderCommand {
|
|||
|
||||
let folder = &self.folder.name;
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -51,7 +51,7 @@ impl FolderDeleteCommand {
|
|||
};
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -39,7 +39,7 @@ impl FolderExpungeCommand {
|
|||
|
||||
let folder = &self.folder.name;
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -40,7 +40,7 @@ impl FolderListCommand {
|
|||
info!("executing list folders command");
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
|
@ -49,7 +49,7 @@ impl FolderPurgeCommand {
|
|||
};
|
||||
|
||||
let (toml_account_config, account_config) = config.clone().into_account_configs(
|
||||
self.account.name.as_ref().map(String::as_str),
|
||||
self.account.name.as_deref(),
|
||||
#[cfg(feature = "account-sync")]
|
||||
self.cache.disable,
|
||||
)?;
|
||||
|
|
Loading…
Reference in a new issue