mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #680] [CLOSED] Refactored the implementation of RangeSet. #1013
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1013
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/680
Author: @ThouCheese
Created: 3/25/2021
Status: ❌ Closed
Base:
dev← Head:rangeset📝 Commits (1)
6a004bfRefactored 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 ofRangecould 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 writingrange1.touches(range2)instead ofrange1.start() <= range2.end() && range1.end() >= range2.start()). I also favoured operator overloading over method calls, so instead ofrange1.minus(range2)we can writerange1 - 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.