[PR #680] [CLOSED] Refactored the implementation of RangeSet. #1013

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/680
Author: @ThouCheese
Created: 3/25/2021
Status: Closed

Base: devHead: rangeset


📝 Commits (1)

  • 6a004bf Refactored the implementation of RangeSet. The original implementation did not

📊 Changes

4 files changed (+625 additions, -164 deletions)

View changed files

📝 audio/src/fetch/mod.rs (+15 -19)
📝 audio/src/fetch/receive.rs (+18 -18)
📝 audio/src/range_set.rs (+273 -127)
audio/src/range_set/range.rs (+319 -0)

📄 Description

Refactored the implementation of RangeSet. The original implementation did not enforce privacy of the fields of Range, which meant that the implementation of Range could not be easily swapped out. I also added tests for all functions of RangeSet and Range. I also added several extra functions to Range that make the implementation of RangeSet a bit more legible (thing like writing range1.touches(range2) instead of range1.start() <= range2.end() && range1.end() >= range2.start()). I also favoured operator overloading over method calls, so instead of range1.minus(range2) we can write range1 - range2. I hope this PR is welcome! Let me know what you think.


🔄 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/680 **Author:** [@ThouCheese](https://github.com/ThouCheese) **Created:** 3/25/2021 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `rangeset` --- ### 📝 Commits (1) - [`6a004bf`](https://github.com/librespot-org/librespot/commit/6a004bfd6541e8272b8abaa4c44cd2ca7fb71e37) Refactored the implementation of RangeSet. The original implementation did not ### 📊 Changes **4 files changed** (+625 additions, -164 deletions) <details> <summary>View changed files</summary> 📝 `audio/src/fetch/mod.rs` (+15 -19) 📝 `audio/src/fetch/receive.rs` (+18 -18) 📝 `audio/src/range_set.rs` (+273 -127) ➕ `audio/src/range_set/range.rs` (+319 -0) </details> ### 📄 Description Refactored the implementation of RangeSet. The original implementation did not enforce privacy of the fields of `Range`, which meant that the implementation of `Range` could not be easily swapped out. I also added tests for all functions of RangeSet and Range. I also added several extra functions to Range that make the implementation of RangeSet a bit more legible (thing like writing `range1.touches(range2)` instead of `range1.start() <= range2.end() && range1.end() >= range2.start()`). I also favoured operator overloading over method calls, so instead of `range1.minus(range2)` we can write `range1 - range2`. I hope this PR is welcome! Let me know what you think. --- <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:49 +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#1013
No description provided.