From a4c330a9133d11b6bc860cbc9c9ec38fc91c220c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 27 Sep 2017 21:19:33 +0200 Subject: Remove unused imports --- src/timetype.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/timetype.rs b/src/timetype.rs index 0d2081b..8ac3245 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -14,7 +14,6 @@ use std::ops::SubAssign; use result::Result; use error::KairosErrorKind as KEK; use error::KairosError as KE; -use error_chain::ChainedError; use indicator::{Day, Month}; use util::*; @@ -1132,11 +1131,8 @@ fn sub_from_moment(mom: NaiveDateTime, tt: TimeType) -> Result { #[cfg(test)] mod tests { use chrono::NaiveDate; - use super::TimeType as TT; - use error::KairosErrorKind as KEK; - #[test] fn test_addition_of_seconds() { let a = TT::seconds(0); @@ -1990,8 +1986,6 @@ mod moment_plus_amount_tests { use env_logger; use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount{ { @@ -2451,8 +2445,6 @@ mod test_time_adjustments { mod test_end_of_year { use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount_and_end_of_year { { @@ -2671,8 +2663,6 @@ mod test_end_of_year { mod test_end_of_month { use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount_and_end_of_month { { @@ -2892,8 +2882,6 @@ mod test_end_of_month { mod test_end_of_day { use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount_and_end_of_day { { @@ -3112,8 +3100,6 @@ mod test_end_of_day { mod test_end_of_hour { use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount_and_end_of_hour { { @@ -3332,8 +3318,6 @@ mod test_end_of_hour { mod test_end_of_minute { use super::TimeType as TT; use chrono::NaiveDate; - use chrono::Timelike; - use chrono::Datelike; macro_rules! generate_test_moment_operator_amount_and_end_of_minute { { -- cgit v1.2.3 From 0d62a02a47cde171cf08c06cc717a01e771de5bd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 27 Sep 2017 21:19:44 +0200 Subject: Remove unused variables --- src/timetype.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/timetype.rs b/src/timetype.rs index 8ac3245..e410723 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -629,7 +629,7 @@ fn add(a: Box, b: Box) -> Result { (TT::EndOfHour(e), other) => Err(KE::from_kind(KEK::CannotAdd(other, TT::EndOfHour(e)))), (other, TT::EndOfHour(e)) => Err(KE::from_kind(KEK::CannotAdd(other, TT::EndOfHour(e)))), - others => unimplemented!(), + _ => unimplemented!(), } } @@ -897,9 +897,8 @@ fn sub(a: Box, b: Box) -> Result { (other, TT::EndOfHour(e)) => Err(KE::from_kind(KEK::CannotSub(other, TT::EndOfHour(e)))), (TT::EndOfMinute(e), other) => Err(KE::from_kind(KEK::CannotSub(other, TT::EndOfMinute(e)))), - (other, TT::EndOfMinute(e)) => Err(KE::from_kind(KEK::CannotSub(other, TT::EndOfMinute(e)))), - - others => unimplemented!(), + // unreachable, but for completeness + //(other, TT::EndOfMinute(e)) => Err(KE::from_kind(KEK::CannotSub(other, TT::EndOfMinute(e)))), } } -- cgit v1.2.3