From ed8f406a61fde421ca8e98f328b4d25b05103d8a Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Fri, 23 Jun 2017 14:47:59 -0500 Subject: [PATCH] Fix Clippy lints: redundant_closure --- src/datetime.rs | 4 ++-- src/naive/datetime.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/datetime.rs b/src/datetime.rs index 7a40d4d..1fc7c18 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -554,7 +554,7 @@ pub mod rustc_serialize { impl Decodable for TsSeconds { fn decode(d: &mut D) -> Result, D::Error> { from(FixedOffset::east(0).timestamp_opt(d.read_i64()?, 0), d) - .map(|dt| TsSeconds(dt)) + .map(TsSeconds) } } @@ -590,7 +590,7 @@ pub mod rustc_serialize { impl Decodable for TsSeconds { fn decode(d: &mut D) -> Result, D::Error> { from(Utc.timestamp_opt(d.read_i64()?, 0), d) - .map(|dt| TsSeconds(dt)) + .map(TsSeconds) } } diff --git a/src/naive/datetime.rs b/src/naive/datetime.rs index 6e628de..50ebd87 100644 --- a/src/naive/datetime.rs +++ b/src/naive/datetime.rs @@ -135,7 +135,7 @@ impl NaiveDateTime { pub fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option { let (days, secs) = div_mod_floor(secs, 86400); let date = days.to_i32().and_then(|days| days.checked_add(719163)) - .and_then(|days_ce| NaiveDate::from_num_days_from_ce_opt(days_ce)); + .and_then(NaiveDate::from_num_days_from_ce_opt); let time = NaiveTime::from_num_seconds_from_midnight_opt(secs as u32, nsecs); match (date, time) { (Some(date), Some(time)) => Some(NaiveDateTime { date: date, time: time }),