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 }),