Fix Clippy lints: redundant_closure

This commit is contained in:
Brandon W Maister 2017-06-23 14:47:59 -05:00
parent 4ca861c905
commit ed8f406a61
2 changed files with 3 additions and 3 deletions

View File

@ -554,7 +554,7 @@ pub mod rustc_serialize {
impl Decodable for TsSeconds<FixedOffset> {
fn decode<D: Decoder>(d: &mut D) -> Result<TsSeconds<FixedOffset>, 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<Utc> {
fn decode<D: Decoder>(d: &mut D) -> Result<TsSeconds<Utc>, D::Error> {
from(Utc.timestamp_opt(d.read_i64()?, 0), d)
.map(|dt| TsSeconds(dt))
.map(TsSeconds)
}
}

View File

@ -135,7 +135,7 @@ impl NaiveDateTime {
pub fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option<NaiveDateTime> {
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 }),