From 80e707e35899e9ee6d2c123b9610e51da7630842 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Mon, 28 May 2018 20:23:00 +0200 Subject: Replace wrong variable in error output of sub_from_moment --- src/timetype.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/timetype.rs b/src/timetype.rs index 7534b8d..8d12226 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -1079,7 +1079,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, @@ -1095,7 +1095,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, @@ -1111,7 +1111,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, @@ -1127,7 +1127,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, @@ -1143,7 +1143,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, @@ -1159,7 +1159,7 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { let tt = NaiveDate::from_ymd_opt(y as i32, mo as u32, d as u32) .and_then(|nd| nd.and_hms_opt(h as u32, mi as u32, s as u32)) - .ok_or(KEK::OutOfBounds(y as i32, mo as u32, h as u32, h as u32, mi as u32, s as u32).into()) + .ok_or(KEK::OutOfBounds(y as i32, mo as u32, d as u32, h as u32, mi as u32, s as u32).into()) .map_err(KE::from_kind)?; Ok(TimeType::moment(tt)) }, -- cgit v1.2.3