[PR #1543] [MERGED] refactor: remove parking_lot dependency and refine feature selections #1433

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1543
Author: @roderickvd
Created: 8/20/2025
Status: Merged
Merged: 9/21/2025
Merged by: @roderickvd

Base: devHead: refactor/no-default-features


📝 Commits (5)

  • 6af7fe0 refactor: refine dependency features and versions in Cargo.toml files
  • 6f473eb chore: update crates
  • fba6495 refactor: switch from parking_lot to std sync primitives
  • 791b18c refactor: remove dashmap dependency and use DefaultKeyedStateStore
  • 6f73a55 refactor: revert to while condition in download loop

📊 Changes

16 files changed (+637 additions, -340 deletions)

View changed files

📝 Cargo.lock (+290 -224)
📝 Cargo.toml (+0 -1)
📝 audio/Cargo.toml (+2 -3)
📝 audio/src/fetch/mod.rs (+30 -12)
📝 audio/src/fetch/receive.rs (+29 -6)
📝 connect/Cargo.toml (+4 -4)
📝 core/Cargo.toml (+7 -13)
📝 core/src/cache.rs (+16 -6)
📝 core/src/component.rs (+6 -3)
📝 core/src/dealer/mod.rs (+46 -8)
📝 core/src/http_client.rs (+3 -6)
📝 core/src/session.rs (+168 -29)
📝 discovery/Cargo.toml (+4 -4)
📝 playback/Cargo.toml (+4 -10)
📝 playback/src/audio_backend/gstreamer.rs (+22 -7)
📝 playback/src/player.rs (+6 -4)

📄 Description

  • Trim Cargo.toml feature selections
  • Remove parking_lot dependency across the entire workspace in favor of standard library synchronization primitives

Trimming feature selections

I went through the dependency tree to apply default-features = false and trimming feature selections where possible.

Removing parking_lot

Some years ago I moved from std::sync::Mutex and friends to parking_lot when I was purging all use of unwrap and expect from the code base. Since then two things happened:

  1. Performance of std synchronization primitives got a lot better;
  2. I got wiser and now understand that when mutexes get poisoned, it's a good thing to propagate that error and panic the calling thread too. This is why we now use expect again here.

Fixes #1382


🔄 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/1543 **Author:** [@roderickvd](https://github.com/roderickvd) **Created:** 8/20/2025 **Status:** ✅ Merged **Merged:** 9/21/2025 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `refactor/no-default-features` --- ### 📝 Commits (5) - [`6af7fe0`](https://github.com/librespot-org/librespot/commit/6af7fe0adc038f4d33799871847c196f2e90571a) refactor: refine dependency features and versions in Cargo.toml files - [`6f473eb`](https://github.com/librespot-org/librespot/commit/6f473ebc0237087cb71687105a91b905d6533427) chore: update crates - [`fba6495`](https://github.com/librespot-org/librespot/commit/fba64955c93c6e575acab0f7d272145d9f6adc9f) refactor: switch from parking_lot to std sync primitives - [`791b18c`](https://github.com/librespot-org/librespot/commit/791b18c3763ec417c68f51c0356c5af21ed632a8) refactor: remove dashmap dependency and use DefaultKeyedStateStore - [`6f73a55`](https://github.com/librespot-org/librespot/commit/6f73a5571b92916b82f604d4745495e99daa82cc) refactor: revert to while condition in download loop ### 📊 Changes **16 files changed** (+637 additions, -340 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+290 -224) 📝 `Cargo.toml` (+0 -1) 📝 `audio/Cargo.toml` (+2 -3) 📝 `audio/src/fetch/mod.rs` (+30 -12) 📝 `audio/src/fetch/receive.rs` (+29 -6) 📝 `connect/Cargo.toml` (+4 -4) 📝 `core/Cargo.toml` (+7 -13) 📝 `core/src/cache.rs` (+16 -6) 📝 `core/src/component.rs` (+6 -3) 📝 `core/src/dealer/mod.rs` (+46 -8) 📝 `core/src/http_client.rs` (+3 -6) 📝 `core/src/session.rs` (+168 -29) 📝 `discovery/Cargo.toml` (+4 -4) 📝 `playback/Cargo.toml` (+4 -10) 📝 `playback/src/audio_backend/gstreamer.rs` (+22 -7) 📝 `playback/src/player.rs` (+6 -4) </details> ### 📄 Description - Trim `Cargo.toml` feature selections - Remove `parking_lot` dependency across the entire workspace in favor of standard library synchronization primitives ## Trimming feature selections I went through the dependency tree to apply `default-features = false` and trimming feature selections where possible. ## Removing `parking_lot` Some years ago I moved from `std::sync::Mutex` and friends to `parking_lot` when I was purging all use of `unwrap` and `expect` from the code base. Since then two things happened: 1. Performance of `std` synchronization primitives got a lot better; 2. I got wiser and now understand that when mutexes get poisoned, it's a good thing to propagate that error and panic the calling thread too. This is why we now use `expect` again here. Fixes #1382 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:02:25 +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#1433
No description provided.