[PR #668] [CLOSED] Eliminate most uses of util module #1009

Closed
opened 2026-02-27 20:00:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/668
Author: @Johannesd3
Created: 3/10/2021
Status: Closed

Base: tokio_migrationHead: diffie-hellman


📝 Commits (4)

  • 9964b46 Reuse librespot-core's Diffie Hellman in discovery
  • ecde3c7 Bump num-bigint dependency
  • ae654ce Almost eliminate util module
  • c9f5ce1 Bump MSRV to 1.45

📊 Changes

11 files changed (+57 additions, -89 deletions)

View changed files

📝 .github/workflows/test.yml (+1 -1)
📝 Cargo.lock (+5 -3)
📝 connect/Cargo.toml (+1 -1)
📝 connect/src/discovery.rs (+9 -18)
📝 connect/src/spirc.rs (+5 -2)
📝 core/Cargo.toml (+2 -1)
📝 core/src/connection/handshake.rs (+5 -3)
📝 core/src/diffie_hellman.rs (+26 -12)
📝 core/src/lib.rs (+2 -0)
📝 core/src/mercury/mod.rs (+1 -2)
📝 core/src/util.rs (+0 -46)

📄 Description

Seems as if Diffie Hellman works exactly the same way in core and discovery, but except of the constants the code wasn't reused until now.

Sequel: Without the use of powm in discovery, it became unnecessary that this function is exposed in the util module. Looking through the other uses of util, I realized that most of them are easy to replace. The last remaining item in util is SeqGenerator as it is used once in spirc.rs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/668 **Author:** [@Johannesd3](https://github.com/Johannesd3) **Created:** 3/10/2021 **Status:** ❌ Closed **Base:** `tokio_migration` ← **Head:** `diffie-hellman` --- ### 📝 Commits (4) - [`9964b46`](https://github.com/librespot-org/librespot/commit/9964b46014e0cb4ceddcb1c2f73cf4ee1fa6b977) Reuse librespot-core's Diffie Hellman in discovery - [`ecde3c7`](https://github.com/librespot-org/librespot/commit/ecde3c7c59bc5e8fed0e6f62b6aa7a3fb93dee49) Bump num-bigint dependency - [`ae654ce`](https://github.com/librespot-org/librespot/commit/ae654ce55b824fe1411df6a6736d88f45336ab59) Almost eliminate util module - [`c9f5ce1`](https://github.com/librespot-org/librespot/commit/c9f5ce122126222985429e91e7fb9b076bf94adc) Bump MSRV to 1.45 ### 📊 Changes **11 files changed** (+57 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yml` (+1 -1) 📝 `Cargo.lock` (+5 -3) 📝 `connect/Cargo.toml` (+1 -1) 📝 `connect/src/discovery.rs` (+9 -18) 📝 `connect/src/spirc.rs` (+5 -2) 📝 `core/Cargo.toml` (+2 -1) 📝 `core/src/connection/handshake.rs` (+5 -3) 📝 `core/src/diffie_hellman.rs` (+26 -12) 📝 `core/src/lib.rs` (+2 -0) 📝 `core/src/mercury/mod.rs` (+1 -2) 📝 `core/src/util.rs` (+0 -46) </details> ### 📄 Description Seems as if Diffie Hellman works exactly the same way in core and discovery, but except of the constants the code wasn't reused until now. Sequel: Without the use of `powm` in discovery, it became unnecessary that this function is exposed in the util module. Looking through the other uses of `util`, I realized that most of them are easy to replace. The last remaining item in `util` is `SeqGenerator` as it is used once in `spirc.rs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:00:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1009
No description provided.