[PR #1076] [MERGED] Fix latest clippy warnings #1222

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1076
Author: @kingosticks
Created: 11/22/2022
Status: Merged
Merged: 11/24/2022
Merged by: @roderickvd

Base: devHead: fix-latest-clippy


📝 Commits (1)

  • 68bbb4f Fix latest clippy and fmt warnings

📊 Changes

3 files changed (+6 additions, -3 deletions)

View changed files

📝 examples/play.rs (+4 -1)
📝 src/main.rs (+1 -1)
📝 src/player_event_handler.rs (+1 -1)

📄 Description

Fixes

warning: the borrowed expression implements the required traits
   --> src/player_event_handler.rs:289:24
    |
289 |     match Command::new(&v.remove(0))
    |                        ^^^^^^^^^^^^ help: change this to: `v.remove(0)`
    |
    = note: `#[warn(clippy::needless_borrow)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: use of `.unwrap_or_else(..)` to construct default value
   --> src/main.rs:698:33
    |
698 |                     let value = matches.opt_str(opt).unwrap_or_else(|| "".to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches.opt_str(opt).unwrap_or_default()`
    |
    = note: `#[warn(clippy::unwrap_or_else_default)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default

🔄 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/1076 **Author:** [@kingosticks](https://github.com/kingosticks) **Created:** 11/22/2022 **Status:** ✅ Merged **Merged:** 11/24/2022 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `fix-latest-clippy` --- ### 📝 Commits (1) - [`68bbb4f`](https://github.com/librespot-org/librespot/commit/68bbb4fbbcb13df4b072b2a4c2c4de3b6c1cec4f) Fix latest clippy and fmt warnings ### 📊 Changes **3 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `examples/play.rs` (+4 -1) 📝 `src/main.rs` (+1 -1) 📝 `src/player_event_handler.rs` (+1 -1) </details> ### 📄 Description Fixes ``` warning: the borrowed expression implements the required traits --> src/player_event_handler.rs:289:24 | 289 | match Command::new(&v.remove(0)) | ^^^^^^^^^^^^ help: change this to: `v.remove(0)` | = note: `#[warn(clippy::needless_borrow)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: use of `.unwrap_or_else(..)` to construct default value --> src/main.rs:698:33 | 698 | let value = matches.opt_str(opt).unwrap_or_else(|| "".to_string()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches.opt_str(opt).unwrap_or_default()` | = note: `#[warn(clippy::unwrap_or_else_default)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:37 +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#1222
No description provided.