Skip to content

Commit d7ea5db

Browse files
committed
Merge #181: refactor: remove wildcard imports from time_extent.rs
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
2 parents 058f3ac + d321ab0 commit d7ea5db

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

src/shared/clock/time_extent.rs

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ pub type DefaultTimeExtentMaker = StoppedTimeExtentMaker;
285285

286286
#[cfg(test)]
287287
mod test {
288-
289288
use crate::shared::clock::time_extent::{
290289
checked_duration_from_nanos, Base, DefaultTimeExtentMaker, Extent, Make, Multiplier, Product, TimeExtent, MAX, ZERO,
291290
};
@@ -296,7 +295,8 @@ mod test {
296295
mod fn_checked_duration_from_nanos {
297296
use std::time::Duration;
298297

299-
use super::*;
298+
use crate::shared::clock::time_extent::checked_duration_from_nanos;
299+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
300300

301301
const NANOS_PER_SEC: u32 = 1_000_000_000;
302302

@@ -335,11 +335,9 @@ mod test {
335335
}
336336

337337
mod time_extent {
338-
use super::*;
339338

340339
mod fn_default {
341-
342-
use super::*;
340+
use crate::shared::clock::time_extent::{TimeExtent, ZERO};
343341

344342
#[test]
345343
fn it_should_default_initialize_to_zero() {
@@ -348,7 +346,8 @@ mod test {
348346
}
349347

350348
mod fn_from_sec {
351-
use super::*;
349+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
350+
use crate::shared::clock::time_extent::{Multiplier, TimeExtent, ZERO};
352351

353352
#[test]
354353
fn it_should_make_empty_for_zero() {
@@ -364,7 +363,8 @@ mod test {
364363
}
365364

366365
mod fn_new {
367-
use super::*;
366+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
367+
use crate::shared::clock::time_extent::{Base, Extent, Multiplier, TimeExtent, ZERO};
368368

369369
#[test]
370370
fn it_should_make_empty_for_zero() {
@@ -386,7 +386,8 @@ mod test {
386386
mod fn_increase {
387387
use std::num::IntErrorKind;
388388

389-
use super::*;
389+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
390+
use crate::shared::clock::time_extent::{Extent, TimeExtent, ZERO};
390391

391392
#[test]
392393
fn it_should_not_increase_for_zero() {
@@ -413,7 +414,8 @@ mod test {
413414
mod fn_decrease {
414415
use std::num::IntErrorKind;
415416

416-
use super::*;
417+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
418+
use crate::shared::clock::time_extent::{Extent, TimeExtent, ZERO};
417419

418420
#[test]
419421
fn it_should_not_decrease_for_zero() {
@@ -438,7 +440,8 @@ mod test {
438440
}
439441

440442
mod fn_total {
441-
use super::*;
443+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
444+
use crate::shared::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO};
442445

443446
#[test]
444447
fn it_should_be_zero_for_zero() {
@@ -485,7 +488,8 @@ mod test {
485488
}
486489

487490
mod fn_total_next {
488-
use super::*;
491+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
492+
use crate::shared::clock::time_extent::{Base, Extent, Product, TimeExtent, MAX, ZERO};
489493

490494
#[test]
491495
fn it_should_be_zero_for_zero() {
@@ -539,10 +543,11 @@ mod test {
539543
}
540544

541545
mod make_time_extent {
542-
use super::*;
543546

544547
mod fn_now {
545-
use super::*;
548+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
549+
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent};
550+
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};
546551

547552
#[test]
548553
fn it_should_give_a_time_extent() {
@@ -580,7 +585,9 @@ mod test {
580585
mod fn_now_after {
581586
use std::time::Duration;
582587

583-
use super::*;
588+
use crate::shared::clock::time_extent::test::TIME_EXTENT_VAL;
589+
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make};
590+
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};
584591

585592
#[test]
586593
fn it_should_give_a_time_extent() {
@@ -617,7 +624,8 @@ mod test {
617624
mod fn_now_before {
618625
use std::time::Duration;
619626

620-
use super::*;
627+
use crate::shared::clock::time_extent::{Base, DefaultTimeExtentMaker, Make, TimeExtent};
628+
use crate::shared::clock::{Current, DurationSinceUnixEpoch, StoppedTime};
621629

622630
#[test]
623631
fn it_should_give_a_time_extent() {

0 commit comments

Comments
 (0)