You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rename NumberOfDownloadsBTreeMap to NumberOfDownloadsPerInfoHash #1964
Rename the type alias NumberOfDownloadsBTreeMap to NumberOfDownloadsPerInfoHash so the name expresses the intent of the type ("downloads per info-hash") rather than its internal implementation (BTreeMap).
Background
The type alias is defined in packages/primitives/src/lib.rs:
It represents the number of completed downloads per info-hash and serves as the persistence boundary for torrent download counts — used by all three database drivers (SQLite, MySQL, PostgreSQL) when loading torrent metrics from the database.
The current name NumberOfDownloadsBTreeMap leaks the implementation detail (BTreeMap). If the underlying collection were ever changed (e.g., to a HashMap), the name would become misleading and need a follow-up rename.
The sibling type NumberOfDownloads is named after what it represents, not how it's stored (u32). The pair should follow the same convention.
A workspace-wide search found 19 source files and 4 documentation files referencing this alias, making this a low-risk but moderately broad rename.
Scope
In Scope
Rename NumberOfDownloadsBTreeMap to NumberOfDownloadsPerInfoHash in packages/primitives/src/lib.rs
Update all references across the workspace (~19 source files + 4 doc files)
Verify linter all and the full test suite pass
Out of Scope
Changing the underlying collection type (BTreeMap → something else)
Renaming other type aliases in the codebase
Changing the NumberOfDownloads alias (already well-named)
Activity
docs(issues): add issue specs for #1964, #1965 (SI-34), and #1966 (SI…
Merge #1967: docs(issues): add issue specs for #1964, #1965 (SI-34), …
Merge torrust#1972: refactor(primitives): rename NumberOfDownloadsBTr…
chore(issues): archive closed issue specs torrust#1447, torrust#1459, t…
Merge #1984: chore(issues): archive 10 closed issue specs from docs/i…