[PR #336] [MERGED] Cleanup with more clippy lints #404

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/336
Author: @marioortizmanero
Created: 7/9/2022
Status: Merged
Merged: 7/31/2022
Merged by: @marioortizmanero

Base: masterHead: clippy-lints


📝 Commits (8)

📊 Changes

25 files changed (+147 additions, -132 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 Cargo.toml (+1 -0)
📝 rspotify-http/Cargo.toml (+1 -0)
📝 rspotify-http/src/ureq.rs (+1 -1)
📝 rspotify-macros/Cargo.toml (+1 -0)
📝 rspotify-model/Cargo.toml (+1 -0)
📝 rspotify-model/src/auth.rs (+4 -2)
📝 rspotify-model/src/context.rs (+1 -1)
📝 rspotify-model/src/custom_serde.rs (+3 -3)
📝 rspotify-model/src/enums/misc.rs (+3 -2)
📝 rspotify-model/src/idtypes.rs (+10 -0)
📝 rspotify-model/src/lib.rs (+0 -1)
📝 rspotify-model/src/offset.rs (+0 -10)
📝 rspotify-model/src/recommend.rs (+43 -42)
📝 rspotify-model/src/show.rs (+1 -1)
📝 src/auth_code.rs (+6 -3)
📝 src/auth_code_pkce.rs (+9 -5)
📝 src/client_creds.rs (+6 -3)
📝 src/clients/base.rs (+19 -24)
📝 src/clients/oauth.rs (+9 -9)

...and 5 more files

📄 Description

Description

This PR cleans up a lot of code thanks to the clippy lints described in #204.

#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]
#![allow(clippy::module_name_repetitions, clippy::module_name_repetitions, clippy::cast_possible_truncation)]
  • Proper metadata in Cargo.toml (categories field)
  • Lots of new #[must_use]
  • Use Self where possible
  • Avoid useless closures
  • Remove useless functions: Offset constructors

Motivation and Context

Some code is overly complex or not well annotated.

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

CI still passes

Is this change properly documented?

Yes


🔄 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/ramsayleung/rspotify/pull/336 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 7/9/2022 **Status:** ✅ Merged **Merged:** 7/31/2022 **Merged by:** [@marioortizmanero](https://github.com/marioortizmanero) **Base:** `master` ← **Head:** `clippy-lints` --- ### 📝 Commits (8) - [`70f3993`](https://github.com/ramsayleung/rspotify/commit/70f399347a51034ebdd13852743b970e86a30115) Minor improvements - [`8fc4e31`](https://github.com/ramsayleung/rspotify/commit/8fc4e31f629c59d54aaec5f217fc6ad03d79ca55) Formatting - [`8ca53df`](https://github.com/ramsayleung/rspotify/commit/8ca53dfa01f596996ea5a47fb09e6b995310855a) Done with rspotify-model - [`1af4ef4`](https://github.com/ramsayleung/rspotify/commit/1af4ef4aa090ce0f8c49445c5772f3068ffab94c) Done with rspotify-http - [`9db12a9`](https://github.com/ramsayleung/rspotify/commit/9db12a93940b8ea09f54fcf2d5edf4d6a80a8dbc) Done for main crate - [`a9691b3`](https://github.com/ramsayleung/rspotify/commit/a9691b3547659d9a4649b0b27450eac8849691d2) Fix tests - [`2c77301`](https://github.com/ramsayleung/rspotify/commit/2c77301fd34211c8aa431fb391acc084211d494b) Fix docs - [`50c30b3`](https://github.com/ramsayleung/rspotify/commit/50c30b340fe0193a6896f964a3bf2fafb44f1ea2) Update changelog ### 📊 Changes **25 files changed** (+147 additions, -132 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `Cargo.toml` (+1 -0) 📝 `rspotify-http/Cargo.toml` (+1 -0) 📝 `rspotify-http/src/ureq.rs` (+1 -1) 📝 `rspotify-macros/Cargo.toml` (+1 -0) 📝 `rspotify-model/Cargo.toml` (+1 -0) 📝 `rspotify-model/src/auth.rs` (+4 -2) 📝 `rspotify-model/src/context.rs` (+1 -1) 📝 `rspotify-model/src/custom_serde.rs` (+3 -3) 📝 `rspotify-model/src/enums/misc.rs` (+3 -2) 📝 `rspotify-model/src/idtypes.rs` (+10 -0) 📝 `rspotify-model/src/lib.rs` (+0 -1) 📝 `rspotify-model/src/offset.rs` (+0 -10) 📝 `rspotify-model/src/recommend.rs` (+43 -42) 📝 `rspotify-model/src/show.rs` (+1 -1) 📝 `src/auth_code.rs` (+6 -3) 📝 `src/auth_code_pkce.rs` (+9 -5) 📝 `src/client_creds.rs` (+6 -3) 📝 `src/clients/base.rs` (+19 -24) 📝 `src/clients/oauth.rs` (+9 -9) _...and 5 more files_ </details> ### 📄 Description ## Description This PR cleans up a lot of code thanks to the clippy lints described in #204. ```rust #![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)] #![allow(clippy::module_name_repetitions, clippy::module_name_repetitions, clippy::cast_possible_truncation)] ``` * Proper metadata in `Cargo.toml` (`categories` field) * Lots of new `#[must_use]` * Use `Self` where possible * Avoid useless closures * Remove useless functions: `Offset` constructors ## Motivation and Context Some code is overly complex or not well annotated. ## Dependencies None ## Type of change Please delete options that are not relevant. - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## How has this been tested? CI still passes ## Is this change properly documented? Yes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:36 +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/rspotify#404
No description provided.