diff --git a/src/protocol/clock/time_extent.rs b/src/protocol/clock/time_extent.rs index b4c20cd70..5eaf3c68f 100644 --- a/src/protocol/clock/time_extent.rs +++ b/src/protocol/clock/time_extent.rs @@ -175,18 +175,15 @@ pub type DefaultTimeExtentMaker = StoppedTimeExtentMaker; #[cfg(test)] mod test { - - use crate::protocol::clock::time_extent::{ - checked_duration_from_nanos, Base, DefaultTimeExtentMaker, Extent, Make, Multiplier, Product, TimeExtent, MAX, ZERO, - }; - use crate::protocol::clock::{Current, DurationSinceUnixEpoch, StoppedTime}; + use super::TimeExtent; const TIME_EXTENT_VAL: TimeExtent = TimeExtent::from_sec(2, &239_812_388_723); mod fn_checked_duration_from_nanos { use std::time::Duration; - use super::*; + use crate::protocol::clock::time_extent::checked_duration_from_nanos; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; const NANOS_PER_SEC: u32 = 1_000_000_000; @@ -225,11 +222,9 @@ mod test { } mod time_extent { - use super::*; mod fn_default { - - use super::*; + use crate::protocol::clock::time_extent::{TimeExtent, ZERO}; #[test] fn it_should_default_initialize_to_zero() { @@ -238,7 +233,8 @@ mod test { } mod fn_from_sec { - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Multiplier, TimeExtent, ZERO}; #[test] fn it_should_make_empty_for_zero() { @@ -254,7 +250,8 @@ mod test { } mod fn_new { - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Base, Extent, Multiplier, TimeExtent, ZERO}; #[test] fn it_should_make_empty_for_zero() { @@ -276,7 +273,8 @@ mod test { mod fn_increase { use std::num::IntErrorKind; - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Extent, TimeExtent, ZERO}; #[test] fn it_should_not_increase_for_zero() { @@ -303,7 +301,8 @@ mod test { mod fn_decrease { use std::num::IntErrorKind; - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Extent, TimeExtent, ZERO}; #[test] fn it_should_not_decrease_for_zero() { @@ -328,7 +327,8 @@ mod test { } mod fn_total { - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO}; #[test] fn it_should_be_zero_for_zero() { @@ -375,7 +375,8 @@ mod test { } mod fn_total_next { - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO}; #[test] fn it_should_be_zero_for_zero() { @@ -429,10 +430,11 @@ mod test { } mod make_time_extent { - use super::*; mod fn_now { - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent}; + use crate::protocol::clock::{Current, DurationSinceUnixEpoch, StoppedTime}; #[test] fn it_should_give_a_time_extent() { @@ -470,7 +472,9 @@ mod test { mod fn_now_after { use std::time::Duration; - use super::*; + use crate::protocol::clock::time_extent::test::TIME_EXTENT_VAL; + use crate::protocol::clock::time_extent::{Base, DefaultTimeExtentMaker, Make}; + use crate::protocol::clock::{Current, DurationSinceUnixEpoch, StoppedTime}; #[test] fn it_should_give_a_time_extent() { @@ -507,7 +511,8 @@ mod test { mod fn_now_before { use std::time::Duration; - use super::*; + use crate::protocol::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent}; + use crate::protocol::clock::{Current, DurationSinceUnixEpoch, StoppedTime}; #[test] fn it_should_give_a_time_extent() {