From 6ae09790aa94fac96583589235142b225fa56a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Wed, 20 May 2026 23:48:27 +0200 Subject: [PATCH] chore: cargo fmt --- src/account/check.rs | 2 +- src/account/context.rs | 2 +- src/backend.rs | 3 ++- src/cli.rs | 2 +- src/config.rs | 2 +- src/imap/client.rs | 2 +- src/imap/envelope/get.rs | 2 +- src/imap/envelope/list.rs | 2 +- src/imap/envelope/search.rs | 2 +- src/imap/envelope/sort.rs | 4 ++-- src/imap/envelope/thread.rs | 4 ++-- src/imap/flag/add.rs | 2 +- src/imap/flag/remove.rs | 2 +- src/imap/flag/set.rs | 2 +- src/imap/id.rs | 2 +- src/imap/message/export.rs | 2 +- src/imap/message/get.rs | 4 ++-- src/imap/message/read.rs | 2 +- src/imap/message/save.rs | 4 ++-- src/jmap/client.rs | 4 ++-- src/jmap/email/copy.rs | 2 +- src/jmap/email/delete.rs | 2 +- src/jmap/email/export.rs | 4 ++-- src/jmap/email/import.rs | 6 +++--- src/jmap/email/query.rs | 9 ++------- src/jmap/email/update.rs | 2 +- src/jmap/identity/create.rs | 2 +- src/jmap/identity/delete.rs | 2 +- src/jmap/identity/update.rs | 2 +- src/jmap/mailbox/create.rs | 2 +- src/jmap/mailbox/destroy.rs | 2 +- src/jmap/mailbox/query.rs | 6 +----- src/jmap/mailbox/update.rs | 2 +- src/jmap/query.rs | 4 ++-- src/jmap/submission/cancel.rs | 2 +- src/jmap/submission/create.rs | 2 +- src/jmap/submission/query.rs | 6 +----- src/jmap/vacation/get.rs | 2 +- src/jmap/vacation/set.rs | 2 +- src/maildir/client.rs | 2 +- src/maildir/envelope/get.rs | 2 +- src/maildir/message/export.rs | 2 +- src/maildir/message/get.rs | 2 +- src/maildir/message/read.rs | 2 +- src/maildir/message/save.rs | 2 +- src/shared/attachments/download.rs | 4 ++-- src/shared/attachments/list.rs | 4 ++-- src/shared/envelopes/list.rs | 6 ++++-- src/shared/mailboxes/arg.rs | 2 +- src/shared/messages/add.rs | 4 ++-- src/shared/messages/builder.rs | 6 +++--- src/shared/messages/compose_with.rs | 2 +- src/shared/messages/forward_with.rs | 2 +- src/shared/messages/mailto.rs | 2 +- src/shared/messages/output.rs | 4 ++-- src/shared/messages/read.rs | 4 ++-- src/shared/messages/read_with.rs | 2 +- src/shared/messages/reply_with.rs | 2 +- src/shared/messages/runner.rs | 2 +- src/shared/messages/send.rs | 2 +- src/smtp/client.rs | 2 +- src/smtp/message/send.rs | 4 ++-- src/wizard/account.rs | 2 +- src/wizard/autoconfig.rs | 2 +- src/wizard/discover.rs | 2 +- src/wizard/edit.rs | 2 +- src/wizard/pacc.rs | 2 +- src/wizard/srv.rs | 2 +- 68 files changed, 90 insertions(+), 100 deletions(-) diff --git a/src/account/check.rs b/src/account/check.rs index 4effc11a..daa4666a 100644 --- a/src/account/check.rs +++ b/src/account/check.rs @@ -17,7 +17,7 @@ use std::{fmt, path::PathBuf}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use pimalaya_cli::printer::Printer; use pimalaya_config::toml::TomlConfig; diff --git a/src/account/context.rs b/src/account/context.rs index 8ffcd497..dc096f56 100644 --- a/src/account/context.rs +++ b/src/account/context.rs @@ -30,7 +30,7 @@ use std::{collections::HashMap, env::temp_dir, path::PathBuf}; -use comfy_table::{presets, Color as TableColor, ContentArrangement}; +use comfy_table::{Color as TableColor, ContentArrangement, presets}; use crossterm::style::Color; use dirs::download_dir; diff --git a/src/backend.rs b/src/backend.rs index 30cad932..1989b48a 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -17,7 +17,7 @@ use std::{fmt, str::FromStr}; -use anyhow::{bail, Error}; +use anyhow::{Error, bail}; use clap::Parser; /// Selects which backend a cross-protocol command should target. @@ -39,6 +39,7 @@ pub enum Backend { Smtp, } +#[allow(unused)] impl Backend { /// Whether the IMAP arm of a shared command is allowed to run. pub fn allows_imap(self) -> bool { diff --git a/src/cli.rs b/src/cli.rs index d415275a..de380a78 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -17,7 +17,7 @@ use std::path::PathBuf; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::{CommandFactory, Parser, Subcommand}; use pimalaya_cli::{ clap::{ diff --git a/src/config.rs b/src/config.rs index 37c85576..3a3a3276 100644 --- a/src/config.rs +++ b/src/config.rs @@ -22,7 +22,7 @@ use comfy_table::ContentArrangement; use crossterm::style::Color; use pimalaya_config::{ secret::Secret, - toml::{shell_expanded_string, TomlConfig}, + toml::{TomlConfig, shell_expanded_string}, }; use pimalaya_stream::{ sasl::{ diff --git a/src/imap/client.rs b/src/imap/client.rs index fa6f3c3c..df1f547d 100644 --- a/src/imap/client.rs +++ b/src/imap/client.rs @@ -27,7 +27,7 @@ use std::{ path::PathBuf, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use io_imap::client::ImapClientStd as Inner; use pimalaya_config::toml::TomlConfig; use pimalaya_stream::{sasl::Sasl, std::stream::StreamStd, tls::Tls}; diff --git a/src/imap/envelope/get.rs b/src/imap/envelope/get.rs index b5af5411..e8742c61 100644 --- a/src/imap/envelope/get.rs +++ b/src/imap/envelope/get.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use comfy_table::{Cell, Row, Table}; use io_imap::types::{ diff --git a/src/imap/envelope/list.rs b/src/imap/envelope/list.rs index 039aef96..5717355b 100644 --- a/src/imap/envelope/list.rs +++ b/src/imap/envelope/list.rs @@ -17,7 +17,7 @@ use std::{collections::BTreeMap, fmt, num::NonZeroU32}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use comfy_table::{Cell, Color, ContentArrangement, Row, Table}; use io_imap::types::{ diff --git a/src/imap/envelope/search.rs b/src/imap/envelope/search.rs index 087cf7b9..a74ec7c1 100644 --- a/src/imap/envelope/search.rs +++ b/src/imap/envelope/search.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use clap::Parser; use comfy_table::{Cell, Color, ContentArrangement, Row, Table}; use io_imap::types::{ diff --git a/src/imap/envelope/sort.rs b/src/imap/envelope/sort.rs index 37bd3979..4b74a6b3 100644 --- a/src/imap/envelope/sort.rs +++ b/src/imap/envelope/sort.rs @@ -17,9 +17,9 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; -use comfy_table::{presets, Cell, Color, ContentArrangement, Row, Table}; +use comfy_table::{Cell, Color, ContentArrangement, Row, Table, presets}; use io_imap::types::{ core::Vec1, extensions::sort::{SortCriterion, SortKey}, diff --git a/src/imap/envelope/thread.rs b/src/imap/envelope/thread.rs index ff021ace..aae8cb4f 100644 --- a/src/imap/envelope/thread.rs +++ b/src/imap/envelope/thread.rs @@ -17,7 +17,7 @@ use std::{collections::HashMap, fmt, num::NonZeroU32}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_imap::types::{ extensions::thread::{Thread, ThreadingAlgorithm}, @@ -25,7 +25,7 @@ use io_imap::types::{ sequence::SequenceSet, }; use pimalaya_cli::printer::Printer; -use serde::{ser::SerializeStruct, Serialize, Serializer}; +use serde::{Serialize, Serializer, ser::SerializeStruct}; use crate::imap::{ client::ImapClient, diff --git a/src/imap/flag/add.rs b/src/imap/flag/add.rs index 77ac357d..a6f8c266 100644 --- a/src/imap/flag/add.rs +++ b/src/imap/flag/add.rs @@ -18,8 +18,8 @@ use anyhow::Result; use clap::Parser; use io_imap::types::{ - flag::{Flag, StoreType}, IntoStatic, + flag::{Flag, StoreType}, }; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/imap/flag/remove.rs b/src/imap/flag/remove.rs index 18e690d0..f36bde9b 100644 --- a/src/imap/flag/remove.rs +++ b/src/imap/flag/remove.rs @@ -18,8 +18,8 @@ use anyhow::Result; use clap::Parser; use io_imap::types::{ - flag::{Flag, StoreType}, IntoStatic, + flag::{Flag, StoreType}, }; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/imap/flag/set.rs b/src/imap/flag/set.rs index bad0ea4b..8f37cee7 100644 --- a/src/imap/flag/set.rs +++ b/src/imap/flag/set.rs @@ -18,8 +18,8 @@ use anyhow::Result; use clap::Parser; use io_imap::types::{ - flag::{Flag, StoreType}, IntoStatic, + flag::{Flag, StoreType}, }; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/imap/id.rs b/src/imap/id.rs index e0362ead..a3155b31 100644 --- a/src/imap/id.rs +++ b/src/imap/id.rs @@ -21,8 +21,8 @@ use anyhow::Result; use clap::Parser; use comfy_table::{Cell, Row, Table}; use io_imap::types::{ - core::{IString, NString}, IntoStatic, + core::{IString, NString}, }; use pimalaya_cli::printer::Printer; use serde::Serialize; diff --git a/src/imap/message/export.rs b/src/imap/message/export.rs index fd1d6c62..c4842320 100644 --- a/src/imap/message/export.rs +++ b/src/imap/message/export.rs @@ -21,7 +21,7 @@ use std::{ path::PathBuf, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName}; use mail_parser::{MessageParser, MimeHeaders}; diff --git a/src/imap/message/get.rs b/src/imap/message/get.rs index f5274f73..3ba23745 100644 --- a/src/imap/message/get.rs +++ b/src/imap/message/get.rs @@ -17,9 +17,9 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; -use comfy_table::{presets, Cell, ContentArrangement, Row, Table}; +use comfy_table::{Cell, ContentArrangement, Row, Table, presets}; use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName}; use mail_parser::{Addr, Address, ContentType, Message, MessageParser, MimeHeaders}; use pimalaya_cli::printer::Printer; diff --git a/src/imap/message/read.rs b/src/imap/message/read.rs index 3d6a67a5..62f4b6db 100644 --- a/src/imap/message/read.rs +++ b/src/imap/message/read.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName}; use mail_parser::{Message, MessageParser}; diff --git a/src/imap/message/save.rs b/src/imap/message/save.rs index ba282adc..6420351a 100644 --- a/src/imap/message/save.rs +++ b/src/imap/message/save.rs @@ -15,12 +15,12 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use std::io::{stdin, BufRead, IsTerminal}; +use std::io::{BufRead, IsTerminal, stdin}; use anyhow::Result; use clap::Parser; use io_imap::types::{ - core::Literal, extensions::binary::LiteralOrLiteral8, flag::Flag, mailbox::Mailbox, IntoStatic, + IntoStatic, core::Literal, extensions::binary::LiteralOrLiteral8, flag::Flag, mailbox::Mailbox, }; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/client.rs b/src/jmap/client.rs index 92b3d200..4c1bbf81 100644 --- a/src/jmap/client.rs +++ b/src/jmap/client.rs @@ -27,8 +27,8 @@ use std::{ path::PathBuf, }; -use anyhow::{anyhow, Result}; -use base64::{prelude::BASE64_STANDARD, Engine}; +use anyhow::{Result, anyhow}; +use base64::{Engine, prelude::BASE64_STANDARD}; use io_jmap::client::JmapClientStd as Inner; use pimalaya_config::toml::TomlConfig; use pimalaya_stream::tls::Tls; diff --git a/src/jmap/email/copy.rs b/src/jmap/email/copy.rs index ae430bc8..8b0947b5 100644 --- a/src/jmap/email/copy.rs +++ b/src/jmap/email/copy.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::email::EmailCopy; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/email/delete.rs b/src/jmap/email/delete.rs index 0d9ee8ef..e1da85b2 100644 --- a/src/jmap/email/delete.rs +++ b/src/jmap/email/delete.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::email_set::JmapEmailSetArgs; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/email/export.rs b/src/jmap/email/export.rs index 519a255f..d1d5c4a8 100644 --- a/src/jmap/email/export.rs +++ b/src/jmap/email/export.rs @@ -15,14 +15,14 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use clap::Parser; use io_jmap::{client::JmapClientStd, rfc8621::capabilities::MAIL}; use pimalaya_cli::printer::{Message, Printer}; use pimalaya_stream::tls::Tls; use url::Url; -use crate::jmap::client::{jmap_http_auth, JmapClient}; +use crate::jmap::client::{JmapClient, jmap_http_auth}; /// Export a raw RFC 5322 message to stdout (Email/get + blob download). /// diff --git a/src/jmap/email/import.rs b/src/jmap/email/import.rs index c48a4f84..3cdf8248 100644 --- a/src/jmap/email/import.rs +++ b/src/jmap/email/import.rs @@ -17,10 +17,10 @@ use std::{ collections::BTreeMap, - io::{stdin, BufRead, IsTerminal}, + io::{BufRead, IsTerminal, stdin}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::{ client::JmapClientStd, @@ -31,7 +31,7 @@ use pimalaya_stream::tls::Tls; use url::Url; use crate::jmap::{ - client::{jmap_http_auth, JmapClient}, + client::{JmapClient, jmap_http_auth}, error::format_set_error, }; diff --git a/src/jmap/email/query.rs b/src/jmap/email/query.rs index 1f0db9b8..cef53afe 100644 --- a/src/jmap/email/query.rs +++ b/src/jmap/email/query.rs @@ -140,11 +140,7 @@ impl JmapEmailQueryCommand { || f.subject.is_some() || f.body.is_some(); - if has_one_filter { - Some(f) - } else { - None - } + if has_one_filter { Some(f) } else { None } }; let sort = Some(vec![EmailComparator { @@ -247,8 +243,7 @@ impl fmt::Display for EmailsTable { row.add_cell(Cell::new(&flags).fg(self.colors.flags)); row.add_cell(Cell::new(e.subject.as_deref().unwrap_or("")).fg(self.colors.subject)); row.add_cell( - Cell::new(format_addresses(e.from.as_deref().unwrap_or(&[]))) - .fg(self.colors.from), + Cell::new(format_addresses(e.from.as_deref().unwrap_or(&[]))).fg(self.colors.from), ); row.add_cell(Cell::new(e.received_at.as_deref().unwrap_or("")).fg(self.colors.date)); table.add_row(row); diff --git a/src/jmap/email/update.rs b/src/jmap/email/update.rs index 4f3d5b03..d8c9b2e9 100644 --- a/src/jmap/email/update.rs +++ b/src/jmap/email/update.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::email_set::JmapEmailSetArgs; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/identity/create.rs b/src/jmap/identity/create.rs index bf6e1282..8dadc302 100644 --- a/src/jmap/identity/create.rs +++ b/src/jmap/identity/create.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::{identity::IdentityCreate, identity_set::JmapIdentitySetArgs}; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/identity/delete.rs b/src/jmap/identity/delete.rs index 116d275e..9749e638 100644 --- a/src/jmap/identity/delete.rs +++ b/src/jmap/identity/delete.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::identity_set::JmapIdentitySetArgs; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/identity/update.rs b/src/jmap/identity/update.rs index 7471f8f2..0ba4e8b0 100644 --- a/src/jmap/identity/update.rs +++ b/src/jmap/identity/update.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::{identity::IdentityUpdate, identity_set::JmapIdentitySetArgs}; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/mailbox/create.rs b/src/jmap/mailbox/create.rs index 16d38f88..61acac7b 100644 --- a/src/jmap/mailbox/create.rs +++ b/src/jmap/mailbox/create.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::{mailbox::MailboxCreate, mailbox_set::JmapMailboxSetArgs}; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/mailbox/destroy.rs b/src/jmap/mailbox/destroy.rs index 19d14187..ef07482e 100644 --- a/src/jmap/mailbox/destroy.rs +++ b/src/jmap/mailbox/destroy.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::mailbox_set::JmapMailboxSetArgs; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/mailbox/query.rs b/src/jmap/mailbox/query.rs index db0fcff3..f4e5ef0a 100644 --- a/src/jmap/mailbox/query.rs +++ b/src/jmap/mailbox/query.rs @@ -88,11 +88,7 @@ impl JmapMailboxQueryCommand { || f.is_subscribed.is_some() || f.has_any_role.is_some(); - if has_one_filter { - Some(f) - } else { - None - } + if has_one_filter { Some(f) } else { None } }; let sort = Some(vec![MailboxSortComparator { diff --git a/src/jmap/mailbox/update.rs b/src/jmap/mailbox/update.rs index 74e8591c..6ef8d2c8 100644 --- a/src/jmap/mailbox/update.rs +++ b/src/jmap/mailbox/update.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::{mailbox::MailboxUpdate, mailbox_set::JmapMailboxSetArgs}; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/query.rs b/src/jmap/query.rs index 9ddfbabd..e7b186c2 100644 --- a/src/jmap/query.rs +++ b/src/jmap/query.rs @@ -17,10 +17,10 @@ use std::{ fmt, - io::{stdin, BufRead}, + io::{BufRead, stdin}, }; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use clap::Parser; use io_jmap::{ rfc8620::{send::JmapRequest, session::capabilities::CORE}, diff --git a/src/jmap/submission/cancel.rs b/src/jmap/submission/cancel.rs index 0dc9041d..d53f3665 100644 --- a/src/jmap/submission/cancel.rs +++ b/src/jmap/submission/cancel.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/jmap/submission/create.rs b/src/jmap/submission/create.rs index 1d259591..fd6cc3cc 100644 --- a/src/jmap/submission/create.rs +++ b/src/jmap/submission/create.rs @@ -17,7 +17,7 @@ use std::collections::BTreeMap; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::email_submission::{ EmailAddressWithParameters, EmailSubmissionCreate, Envelope, diff --git a/src/jmap/submission/query.rs b/src/jmap/submission/query.rs index e1e3fe9b..a3a15c4b 100644 --- a/src/jmap/submission/query.rs +++ b/src/jmap/submission/query.rs @@ -80,11 +80,7 @@ impl JmapSubmissionQueryCommand { let has_one = f.undo_status.is_some() || f.before.is_some() || f.after.is_some(); - if has_one { - Some(f) - } else { - None - } + if has_one { Some(f) } else { None } }; let output = client.email_submission_query( diff --git a/src/jmap/vacation/get.rs b/src/jmap/vacation/get.rs index 07c71fb9..0cd2cdee 100644 --- a/src/jmap/vacation/get.rs +++ b/src/jmap/vacation/get.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use comfy_table::{Cell, Row, Table}; use io_jmap::rfc8621::{capabilities::VACATION_RESPONSE, vacation_response::VacationResponse}; diff --git a/src/jmap/vacation/set.rs b/src/jmap/vacation/set.rs index 9a4f0af4..75d12552 100644 --- a/src/jmap/vacation/set.rs +++ b/src/jmap/vacation/set.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_jmap::rfc8621::{ capabilities::VACATION_RESPONSE, vacation_response::VacationResponseUpdate, diff --git a/src/maildir/client.rs b/src/maildir/client.rs index d0dfe590..09fec4df 100644 --- a/src/maildir/client.rs +++ b/src/maildir/client.rs @@ -27,7 +27,7 @@ use std::{ path::PathBuf, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use io_maildir::client::MaildirClient as Inner; use pimalaya_config::toml::TomlConfig; diff --git a/src/maildir/envelope/get.rs b/src/maildir/envelope/get.rs index 21e98e60..08342c1e 100644 --- a/src/maildir/envelope/get.rs +++ b/src/maildir/envelope/get.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use comfy_table::{Cell, Row, Table}; use io_maildir::maildir::Maildir; diff --git a/src/maildir/message/export.rs b/src/maildir/message/export.rs index 103d7842..ba3d42b7 100644 --- a/src/maildir/message/export.rs +++ b/src/maildir/message/export.rs @@ -17,7 +17,7 @@ use std::{fmt, fs, path::PathBuf}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::{Parser, ValueEnum}; use convert_case::ccase; use io_maildir::maildir::Maildir; diff --git a/src/maildir/message/get.rs b/src/maildir/message/get.rs index 16b818a4..ef35278f 100644 --- a/src/maildir/message/get.rs +++ b/src/maildir/message/get.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_maildir::maildir::Maildir; use mail_parser::Message; diff --git a/src/maildir/message/read.rs b/src/maildir/message/read.rs index cafbcf9c..cdb0bc9b 100644 --- a/src/maildir/message/read.rs +++ b/src/maildir/message/read.rs @@ -17,7 +17,7 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_maildir::maildir::Maildir; use mail_parser::Message; diff --git a/src/maildir/message/save.rs b/src/maildir/message/save.rs index 2ff11fcc..36b2dd1c 100644 --- a/src/maildir/message/save.rs +++ b/src/maildir/message/save.rs @@ -17,7 +17,7 @@ use std::{ fmt, - io::{stdin, BufRead, IsTerminal}, + io::{BufRead, IsTerminal, stdin}, path::PathBuf, }; diff --git a/src/shared/attachments/download.rs b/src/shared/attachments/download.rs index 3b87c93c..3d7d0528 100644 --- a/src/shared/attachments/download.rs +++ b/src/shared/attachments/download.rs @@ -21,13 +21,13 @@ use std::{ path::{Path, PathBuf}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use mail_parser::{MessageParser, MimeHeaders}; use pimalaya_cli::printer::Printer; use crate::shared::{ - attachments::list::{mime_string, Attachment, AttachmentColors, Attachments}, + attachments::list::{Attachment, AttachmentColors, Attachments, mime_string}, client::EmailClient, mailboxes::arg::MailboxArg, }; diff --git a/src/shared/attachments/list.rs b/src/shared/attachments/list.rs index ec3ea4da..550ca9f3 100644 --- a/src/shared/attachments/list.rs +++ b/src/shared/attachments/list.rs @@ -17,10 +17,10 @@ use std::fmt; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use comfy_table::{Cell, Color, ContentArrangement, Row, Table}; -use humansize::{format_size, BINARY}; +use humansize::{BINARY, format_size}; use mail_parser::{MessageParser, MessagePart, MimeHeaders}; use pimalaya_cli::printer::Printer; use serde::Serialize; diff --git a/src/shared/envelopes/list.rs b/src/shared/envelopes/list.rs index d53b4cac..cd57aaae 100644 --- a/src/shared/envelopes/list.rs +++ b/src/shared/envelopes/list.rs @@ -21,7 +21,7 @@ use anyhow::Result; use chrono::{DateTime, FixedOffset, Local}; use clap::Parser; use comfy_table::{Cell, Color, ContentArrangement, Row, Table}; -use humansize::{format_size, BINARY}; +use humansize::{BINARY, format_size}; use io_email::{address::Address, envelope::Envelope, flag::Flag}; use pimalaya_cli::printer::Printer; use serde::Serialize; @@ -184,7 +184,9 @@ impl fmt::Display for Envelopes { let mut row = Row::new(); row.max_height(1); row.add_cell(Cell::new(&env.id).fg(self.colors.id)); - row.add_cell(Cell::new(format_flags(&env.flags, &self.chars)).fg(self.colors.flags)); + row.add_cell( + Cell::new(format_flags(&env.flags, &self.chars)).fg(self.colors.flags), + ); if self.with_attachment { row.add_cell( Cell::new(format_attachment(env.has_attachment, self.chars.attachment)) diff --git a/src/shared/mailboxes/arg.rs b/src/shared/mailboxes/arg.rs index cb74f7b5..7e9c35ed 100644 --- a/src/shared/mailboxes/arg.rs +++ b/src/shared/mailboxes/arg.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use clap::Parser; use crate::account::context::Account; diff --git a/src/shared/messages/add.rs b/src/shared/messages/add.rs index 989e54e4..28c97b2a 100644 --- a/src/shared/messages/add.rs +++ b/src/shared/messages/add.rs @@ -16,11 +16,11 @@ // along with this program. If not, see . use std::{ - io::{stdin, IsTerminal, Read}, + io::{IsTerminal, Read, stdin}, path::PathBuf, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_email::flag::Flag; use pimalaya_cli::printer::Message; diff --git a/src/shared/messages/builder.rs b/src/shared/messages/builder.rs index 215f3e59..778729b7 100644 --- a/src/shared/messages/builder.rs +++ b/src/shared/messages/builder.rs @@ -29,15 +29,15 @@ //! external command and never go through this module. use std::{ - io::{stdin, IsTerminal, Read as _}, + io::{IsTerminal, Read as _, stdin}, path::{Path, PathBuf}, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use clap::ValueEnum; use mail_builder::{ - headers::{address::Address, raw::Raw}, MessageBuilder, + headers::{address::Address, raw::Raw}, }; use mail_parser::{HeaderValue, MessageParser}; diff --git a/src/shared/messages/compose_with.rs b/src/shared/messages/compose_with.rs index 7675fa5b..eaa4e24d 100644 --- a/src/shared/messages/compose_with.rs +++ b/src/shared/messages/compose_with.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use pimalaya_cli::printer::Printer; diff --git a/src/shared/messages/forward_with.rs b/src/shared/messages/forward_with.rs index 80431a9f..f2f13f67 100644 --- a/src/shared/messages/forward_with.rs +++ b/src/shared/messages/forward_with.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use pimalaya_cli::printer::Printer; diff --git a/src/shared/messages/mailto.rs b/src/shared/messages/mailto.rs index bf583f12..addfaaf5 100644 --- a/src/shared/messages/mailto.rs +++ b/src/shared/messages/mailto.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use clap::Parser; use percent_encoding::percent_decode_str; use pimalaya_cli::printer::Printer; diff --git a/src/shared/messages/output.rs b/src/shared/messages/output.rs index fb3abcc5..96963040 100644 --- a/src/shared/messages/output.rs +++ b/src/shared/messages/output.rs @@ -23,9 +23,9 @@ //! `Sent` mailbox. With neither flag, the raw bytes are written to //! stdout — same shape as a manual `mml compile > out.eml`. -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use mail_parser::{Address as ParserAddress, HeaderValue, MessageParser}; use pimalaya_cli::printer::{Message, Printer}; diff --git a/src/shared/messages/read.rs b/src/shared/messages/read.rs index 08fc8d83..1a8a641a 100644 --- a/src/shared/messages/read.rs +++ b/src/shared/messages/read.rs @@ -17,10 +17,10 @@ use std::{ fmt, - io::{stdout, Write}, + io::{Write, stdout}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use mail_parser::{Message, MessageParser}; use pimalaya_cli::printer::Printer; diff --git a/src/shared/messages/read_with.rs b/src/shared/messages/read_with.rs index 0a6a76ae..eca3e82f 100644 --- a/src/shared/messages/read_with.rs +++ b/src/shared/messages/read_with.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; use anyhow::Result; use clap::Parser; diff --git a/src/shared/messages/reply_with.rs b/src/shared/messages/reply_with.rs index 3d65b2db..81ef4889 100644 --- a/src/shared/messages/reply_with.rs +++ b/src/shared/messages/reply_with.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use pimalaya_cli::printer::Printer; diff --git a/src/shared/messages/runner.rs b/src/shared/messages/runner.rs index 3cb69681..de0690cb 100644 --- a/src/shared/messages/runner.rs +++ b/src/shared/messages/runner.rs @@ -31,7 +31,7 @@ use std::{ process::{Command, Stdio}, }; -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use crate::config::{ComposerConfig, ReaderConfig}; diff --git a/src/shared/messages/send.rs b/src/shared/messages/send.rs index a3dcab78..af3310c6 100644 --- a/src/shared/messages/send.rs +++ b/src/shared/messages/send.rs @@ -16,7 +16,7 @@ // along with this program. If not, see . use std::{ - io::{stdin, BufRead, IsTerminal}, + io::{BufRead, IsTerminal, stdin}, path::PathBuf, }; diff --git a/src/smtp/client.rs b/src/smtp/client.rs index 86701911..702a326c 100644 --- a/src/smtp/client.rs +++ b/src/smtp/client.rs @@ -29,7 +29,7 @@ use std::{ path::PathBuf, }; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use io_smtp::{client::SmtpClientStd as Inner, rfc5321::types::ehlo_domain::EhloDomain}; use pimalaya_config::toml::TomlConfig; use pimalaya_stream::{sasl::Sasl, std::stream::StreamStd, tls::Tls}; diff --git a/src/smtp/message/send.rs b/src/smtp/message/send.rs index 30802860..2cdea61f 100644 --- a/src/smtp/message/send.rs +++ b/src/smtp/message/send.rs @@ -18,10 +18,10 @@ use std::{ borrow::Cow, collections::HashSet, - io::{stdin, BufRead, IsTerminal}, + io::{BufRead, IsTerminal, stdin}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use clap::Parser; use io_smtp::rfc5321::types::{ domain::Domain, ehlo_domain::EhloDomain, forward_path::ForwardPath, local_part::LocalPart, diff --git a/src/wizard/account.rs b/src/wizard/account.rs index 392b2910..6e93566b 100644 --- a/src/wizard/account.rs +++ b/src/wizard/account.rs @@ -23,7 +23,7 @@ use std::process::Command; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use pimalaya_cli::wizard::{ imap::{Encryption as ImapEncryption, ImapAuth, ImapSecret, WizardImapConfig}, jmap::{JmapAuth, JmapSecret, WizardJmapConfig}, diff --git a/src/wizard/autoconfig.rs b/src/wizard/autoconfig.rs index 74d374c9..c3944fe4 100644 --- a/src/wizard/autoconfig.rs +++ b/src/wizard/autoconfig.rs @@ -33,7 +33,7 @@ use pimalaya_cli::{ }, }; -use crate::wizard::discover::{discovery_resolver, discovery_tls, DiscoveryResult}; +use crate::wizard::discover::{DiscoveryResult, discovery_resolver, discovery_tls}; pub fn run(local_part: &str, domain: &str) -> Option { let mut client = diff --git a/src/wizard/discover.rs b/src/wizard/discover.rs index f44c6b7e..4ebbd246 100644 --- a/src/wizard/discover.rs +++ b/src/wizard/discover.rs @@ -34,7 +34,7 @@ use std::{collections::HashMap, path::Path, process::exit}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use log::info; use pimalaya_cli::{ prompt, diff --git a/src/wizard/edit.rs b/src/wizard/edit.rs index 5fdbce1c..b0e7868f 100644 --- a/src/wizard/edit.rs +++ b/src/wizard/edit.rs @@ -23,7 +23,7 @@ use std::path::Path; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use log::info; use pimalaya_cli::{ prompt, diff --git a/src/wizard/pacc.rs b/src/wizard/pacc.rs index b44e1aa9..8c11fa93 100644 --- a/src/wizard/pacc.rs +++ b/src/wizard/pacc.rs @@ -28,7 +28,7 @@ use pimalaya_cli::{ }, }; -use crate::wizard::discover::{discovery_resolver, discovery_tls, DiscoveryResult}; +use crate::wizard::discover::{DiscoveryResult, discovery_resolver, discovery_tls}; pub fn run(domain: &str) -> Option { let spinner = Spinner::start(format!("Probing PACC for {domain}…")); diff --git a/src/wizard/srv.rs b/src/wizard/srv.rs index 9dbf1f68..b03b3447 100644 --- a/src/wizard/srv.rs +++ b/src/wizard/srv.rs @@ -36,7 +36,7 @@ use pimalaya_cli::{ }, }; -use crate::wizard::discover::{discovery_resolver, DiscoveryResult}; +use crate::wizard::discover::{DiscoveryResult, discovery_resolver}; pub fn run(domain: &str) -> Option { let spinner = Spinner::start(format!("Probing SRV records for {domain}…"));