mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1635] [MERGED] Make SpotifyId base62 / base16 methods infallible #1470
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#1470
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/1635
Author: @wfraser
Created: 11/12/2025
Status: ✅ Merged
Merged: 11/14/2025
Merged by: @photovoltex
Base:
dev← Head:spotify-id-base62-infallible📝 Commits (4)
2950d73make SpotifyId::to_base62() infallible51c4480make {SpotifyId, FileId}::to_base16() infallible too7f3203ffix core unit testsf2e80f0changelog entry📊 Changes
9 files changed (+168 additions, -264 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
core/src/cache.rs(+6 -11)📝
core/src/file_id.rs(+8 -6)📝
core/src/spclient.rs(+8 -8)📝
core/src/spotify_id.rs(+14 -42)📝
core/src/spotify_uri.rs(+8 -10)📝
metadata/src/playlist/annotation.rs(+1 -1)📝
playback/src/player.rs(+1 -4)📝
src/player_event_handler.rs(+118 -182)📄 Description
For both of these, the only error case is a non-utf8 string, which is impossible since we're building it from a fixed alphabet.
This allows removing a bunch of unnecessary error handling branches.
Also, for base16, there's no need to implement parsing/formatting, just use the stdlib's hex conversion/formatting code.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.