Skip to content

Commit 99bf2a5

Browse files
committed
Merge #1791: feat(clock): move DurationSinceUnixEpoch to torrust-tracker-clock (#1790)
a6bd710 docs(issues): address Copilot review on PR #1791 (Jose Celano) b7fae8b docs(issues): update spec #1790 — PR #1791 opened, acceptance criteria checked (Jose Celano) 9f8ab59 feat(clock): move DurationSinceUnixEpoch to torrust-tracker-clock (#1790) (Jose Celano) 5affd26 docs(issues): add issue spec for #1790 (move DurationSinceUnixEpoch to torrust-tracker-clock) (Jose Celano) Pull request description: ## Summary Move the `DurationSinceUnixEpoch` type alias from `torrust-tracker-primitives` into `torrust-tracker-clock`, where it semantically belongs. Closes #1790. ## Motivation `DurationSinceUnixEpoch` is a trivial alias for `std::time::Duration` with no tracker-specific logic. It lives in `torrust-tracker-primitives` only by historical accident. The primary user is `torrust-tracker-clock` (the `Clock` trait and conversion helpers), which had to carry a `torrust-tracker-primitives` dependency solely for this type. Moving it: - Removes the `torrust-tracker-primitives` dep from `torrust-tracker-clock`, making it dependency-lighter - Prepares `torrust-tracker-clock` for future extraction to a standalone repository (SI-09, SI-13 in EPIC #1669) ## Changes - **`packages/clock/src/lib.rs`** — add `pub type DurationSinceUnixEpoch = std::time::Duration` - **`packages/clock/Cargo.toml`** — remove `torrust-tracker-primitives` dependency - **`packages/primitives/src/lib.rs`** — replace the type definition with `#[deprecated] pub use torrust_tracker_clock::DurationSinceUnixEpoch` (backward-compatible re-export; deprecated to guide consumers to the new path) - **`packages/primitives/src/peer.rs`** — import `DurationSinceUnixEpoch` directly from `torrust_tracker_clock` (bypasses the deprecated re-export to keep the build clean under `-D deprecated`) - **`packages/metrics/Cargo.toml`** — replace `torrust-tracker-primitives` dep with `torrust-tracker-clock` - **77 workspace `.rs` files** — update import path from `torrust_tracker_primitives::DurationSinceUnixEpoch` to `torrust_tracker_clock::DurationSinceUnixEpoch` - **Docs** — issue spec and EPIC #1669 SI-02 row updated to DONE ## Verification - `cargo build --workspace` — clean (zero errors, zero warnings) - `cargo test --doc --workspace` — all pass - `cargo test --tests --benches --examples --workspace --all-targets --all-features` — all pass - `linter all` — all linters pass (markdown, yaml, toml, cspell, clippy, rustfmt, shellcheck) - `cargo machete` — no unused dependencies - E2E tests (SQLite3) — pass ACKs for top commit: josecelano: ACK a6bd710 Tree-SHA512: 6a438f685510bd289b1eb325064103a3026101808a4941a3eaef331133e025718b5333737a587148a094db03cf16b8465ec42ed02dbb31f5b0b5f8cd9e9077c6
2 parents 69f127b + a6bd710 commit 99bf2a5

91 files changed

Lines changed: 366 additions & 313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/issues/drafts/1669-02-move-duration-since-unix-epoch-to-torrust-clock.md

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)