summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hurst <tom@hur.st>2018-09-04 22:48:47 +0100
committerKartikaya Gupta (kats) <staktrace@users.noreply.github.com>2018-09-05 04:05:28 -0400
commit44e2c74bc6c3427af94f46e91e1d73bbf8a3346e (patch)
tree9530d42187598b66296386f532110cd9a4ba44f3
parentbd195df0a8fc1615729bf01ea572f7e1f3e3b86c (diff)
downloadmailparse-44e2c74bc6c3427af94f46e91e1d73bbf8a3346e.tar.gz
mailparse-44e2c74bc6c3427af94f46e91e1d73bbf8a3346e.tar.xz
Use if let Ok() over single-armed match { .. }
clippy:single_match
-rw-r--r--src/dateparse.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/dateparse.rs b/src/dateparse.rs
index f699216..4da8b13 100644
--- a/src/dateparse.rs
+++ b/src/dateparse.rs
@@ -84,12 +84,9 @@ pub fn dateparse(date: &str) -> Result<i64, &'static str> {
}
match state {
DateParseState::Date => {
- match tok.parse::<u8>() {
- Ok(v) => {
- day_of_month = v;
- state = DateParseState::Month;
- }
- Err(_) => (),
+ if let Ok(v) = tok.parse::<u8>() {
+ day_of_month = v;
+ state = DateParseState::Month;
};
continue;
}