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:
Perma Alesheikh 2024-01-09 12:35:32 +03:30 committed by Clément DOUIN
parent 59fefd7c78
commit f7a7937cb1
No known key found for this signature in database
GPG key ID: 353E4A18EE0FAB72
26 changed files with 26 additions and 26 deletions

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;

View file

@ -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,
)?;