Skip to content

Commit

Permalink
Merge #181: refactor: remove wildcard imports from time_extent.rs
Browse files Browse the repository at this point in the history
d321ab0 refactor: remove wildcard imports from time_extent.rs (Cameron Garnham)

Pull request description:

  This was the only use of the `::*` within torrust-tracker. Better to remove it.

ACKs for top commit:
  da2ce7:
    ACK d321ab0

Tree-SHA512: f813c250dacc1b4e833816e4b18bffe5bb1e22240acc392e9c8b351156c02811977490205c26aaec2860a178459baf7d236c2c210b7f95a0e850fa9df0ca28a8
  • Loading branch information
da2ce7 committed Jul 26, 2023
2 parents 058f3ac + d321ab0 commit d7ea5db
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/shared/clock/time_extent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ pub type DefaultTimeExtentMaker = StoppedTimeExtentMaker;

#[cfg(test)]
mod test {

use crate::shared::clock::time_extent::{
checked_duration_from_nanos, Base, DefaultTimeExtentMaker, Extent, Make, Multiplier, Product, TimeExtent, MAX, ZERO,
};
Expand All @@ -296,7 +295,8 @@ mod test {
mod fn_checked_duration_from_nanos {
use std::time::Duration;

use super::*;
use crate::shared::clock::time_extent::checked_duration_from_nanos;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;

const NANOS_PER_SEC: u32 = 1_000_000_000;

Expand Down Expand Up @@ -335,11 +335,9 @@ mod test {
}

mod time_extent {
use super::*;

mod fn_default {

use super::*;
use crate::shared::clock::time_extent::{TimeExtent, ZERO};

#[test]
fn it_should_default_initialize_to_zero() {
Expand All @@ -348,7 +346,8 @@ mod test {
}

mod fn_from_sec {
use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Multiplier, TimeExtent, ZERO};

#[test]
fn it_should_make_empty_for_zero() {
Expand All @@ -364,7 +363,8 @@ mod test {
}

mod fn_new {
use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Base, Extent, Multiplier, TimeExtent, ZERO};

#[test]
fn it_should_make_empty_for_zero() {
Expand All @@ -386,7 +386,8 @@ mod test {
mod fn_increase {
use std::num::IntErrorKind;

use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Extent, TimeExtent, ZERO};

#[test]
fn it_should_not_increase_for_zero() {
Expand All @@ -413,7 +414,8 @@ mod test {
mod fn_decrease {
use std::num::IntErrorKind;

use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Extent, TimeExtent, ZERO};

#[test]
fn it_should_not_decrease_for_zero() {
Expand All @@ -438,7 +440,8 @@ mod test {
}

mod fn_total {
use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO};

#[test]
fn it_should_be_zero_for_zero() {
Expand Down Expand Up @@ -485,7 +488,8 @@ mod test {
}

mod fn_total_next {
use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO};

#[test]
fn it_should_be_zero_for_zero() {
Expand Down Expand Up @@ -539,10 +543,11 @@ mod test {
}

mod make_time_extent {
use super::*;

mod fn_now {
use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent};
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};

#[test]
fn it_should_give_a_time_extent() {
Expand Down Expand Up @@ -580,7 +585,9 @@ mod test {
mod fn_now_after {
use std::time::Duration;

use super::*;
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make};
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};

#[test]
fn it_should_give_a_time_extent() {
Expand Down Expand Up @@ -617,7 +624,8 @@ mod test {
mod fn_now_before {
use std::time::Duration;

use super::*;
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent};
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};

#[test]
fn it_should_give_a_time_extent() {
Expand Down

0 comments on commit d7ea5db

Please sign in to comment.