summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:22:26 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:41 +0200
commit8726cb12cf79bd401a061f2775df718368f6cdd1 (patch)
tree4701c312ba9f99bdb76667cfc2c78d5283cbe07d
parent6307b80027065237f50e1887e4bbbc2fe945d4b7 (diff)
[No-auto] lib/domain/mail: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/domain/libimagmail/src/config.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/domain/libimagmail/src/config.rs b/lib/domain/libimagmail/src/config.rs
index 6258e6e3..a58784ae 100644
--- a/lib/domain/libimagmail/src/config.rs
+++ b/lib/domain/libimagmail/src/config.rs
@@ -51,8 +51,7 @@ impl MailConfig {
pub fn account(&self, name: &str) -> Option<&MailAccountConfig> {
self.accounts()
.iter()
- .filter(|a| a.name == name)
- .next()
+ .find(|a| a.name == name)
}
pub fn fetchcommand(&self) -> &MailCommand {
@@ -74,8 +73,7 @@ impl MailConfig {
pub fn fetchcommand_for_account(&self, account_name: &str) -> &MailCommand {
self.accounts()
.iter()
- .filter(|a| a.name == account_name)
- .next()
+ .find(|a| a.name == account_name)
.and_then(|a| a.fetchcommand.as_ref())
.unwrap_or_else(|| self.fetchcommand())
}
@@ -83,8 +81,7 @@ impl MailConfig {
pub fn postfetchcommand_for_account(&self, account_name: &str) -> Option<&MailCommand> {
self.accounts()
.iter()
- .filter(|a| a.name == account_name)
- .next()
+ .find(|a| a.name == account_name)
.and_then(|a| a.postfetchcommand.as_ref())
.or_else(|| self.postfetchcommand())
}
@@ -92,8 +89,7 @@ impl MailConfig {
pub fn sendcommand_for_account(&self, account_name: &str) -> &MailCommand {
self.accounts()
.iter()
- .filter(|a| a.name == account_name)
- .next()
+ .find(|a| a.name == account_name)
.and_then(|a| a.sendcommand.as_ref())
.unwrap_or_else(|| self.sendcommand())
}
@@ -101,8 +97,7 @@ impl MailConfig {
pub fn postsendcommand_for_account(&self, account_name: &str) -> Option<&MailCommand> {
self.accounts()
.iter()
- .filter(|a| a.name == account_name)
- .next()
+ .find(|a| a.name == account_name)
.and_then(|a| a.postsendcommand.as_ref())
.or_else(|| self.postsendcommand())
}