[PR #106] [MERGED] Extern crate, Cargo.toml cleanup #247

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/106
Author: @marioortizmanero
Created: 8/12/2020
Status: Merged
Merged: 8/13/2020
Merged by: @ramsayleung

Base: masterHead: extern-crate


📝 Commits (10+)

  • 5073244 remove extern crate for 'log'
  • c1dda8e remove unnecessary 'base64' and 'env_logger'
  • 8415079 remove extern crate for 'chrono'
  • 6c917a2 remove extern crate for 'url'
  • 629aab7 remove extern crate for 'rand'
  • 335eb01 remove extern crate for 'percent_encoding'
  • 5cfdc1c remove extern crate for 'dotenv'
  • 1196fa2 remove extern crate for 'lazy_static'
  • 22c914b remove extern crate for 'itertools'
  • 418347a remove extern crate for 'failure'

📊 Changes

168 files changed (+77 additions, -418 deletions)

View changed files

📝 Cargo.toml (+15 -74)
📝 README.md (+0 -4)
📝 examples/add_to_queue.rs (+0 -2)
📝 examples/album.rs (+0 -2)
📝 examples/album_tracks.rs (+0 -2)
📝 examples/albums.rs (+0 -2)
📝 examples/artist.rs (+0 -2)
📝 examples/artist_related_artists.rs (+0 -2)
📝 examples/artist_top_tracks.rs (+0 -1)
📝 examples/artists.rs (+0 -2)
📝 examples/artists_albums.rs (+0 -2)
📝 examples/audio_analysis.rs (+0 -2)
📝 examples/audio_features.rs (+0 -2)
📝 examples/audios_features.rs (+0 -2)
📝 examples/blocking/add_to_queue.rs (+0 -1)
📝 examples/blocking/artist_top_tracks.rs (+0 -2)
📝 examples/blocking/categories.rs (+0 -3)
📝 examples/blocking/check_users_saved_shows.rs (+0 -2)
📝 examples/blocking/current_playback.rs (+0 -2)
📝 examples/blocking/current_playing.rs (+0 -2)

...and 80 more files

📄 Description

extern crate is no longer needed after Rust 2018, so I've removed all of them, using use in its place.

I also removed some unnecessary crates:

  • base64: not used at all
  • env_logger: not used at all
  • url: not used at all
  • itertools: only used once in client.rs, found a cleaner solution to avoid using iproduct

And other small improvements in Cargo.toml.

The one thing I don't know how to solve is the reqwest-related features. Wouldn't it make sense to just remove these extern crate? The Cargo.toml will already make sure the correct features for reqwest are being used.


🔄 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/106 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 8/12/2020 **Status:** ✅ Merged **Merged:** 8/13/2020 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `extern-crate` --- ### 📝 Commits (10+) - [`5073244`](https://github.com/ramsayleung/rspotify/commit/507324451a16093157bf9e4a7274d523d943158a) remove extern crate for 'log' - [`c1dda8e`](https://github.com/ramsayleung/rspotify/commit/c1dda8e0635430862250f2d09500287e33315b47) remove unnecessary 'base64' and 'env_logger' - [`8415079`](https://github.com/ramsayleung/rspotify/commit/841507976d74b7ff146f61be8e14bc56d56d068b) remove extern crate for 'chrono' - [`6c917a2`](https://github.com/ramsayleung/rspotify/commit/6c917a218a9dd36d240ebc023f9958f834082dd2) remove extern crate for 'url' - [`629aab7`](https://github.com/ramsayleung/rspotify/commit/629aab7b28a914842afd632834b27463f3b9be75) remove extern crate for 'rand' - [`335eb01`](https://github.com/ramsayleung/rspotify/commit/335eb018dbd68728be1931db085613de4c135e2b) remove extern crate for 'percent_encoding' - [`5cfdc1c`](https://github.com/ramsayleung/rspotify/commit/5cfdc1c246e5dd714ec2d7ff897864b33df4ddd8) remove extern crate for 'dotenv' - [`1196fa2`](https://github.com/ramsayleung/rspotify/commit/1196fa2607993de90df1cf3577d8c1f617b5b545) remove extern crate for 'lazy_static' - [`22c914b`](https://github.com/ramsayleung/rspotify/commit/22c914b4d296f08701172e1a351b2c9d3ac44f5d) remove extern crate for 'itertools' - [`418347a`](https://github.com/ramsayleung/rspotify/commit/418347a4a8e4e30d238946f7b30b54dcaa68c05c) remove extern crate for 'failure' ### 📊 Changes **168 files changed** (+77 additions, -418 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+15 -74) 📝 `README.md` (+0 -4) 📝 `examples/add_to_queue.rs` (+0 -2) 📝 `examples/album.rs` (+0 -2) 📝 `examples/album_tracks.rs` (+0 -2) 📝 `examples/albums.rs` (+0 -2) 📝 `examples/artist.rs` (+0 -2) 📝 `examples/artist_related_artists.rs` (+0 -2) 📝 `examples/artist_top_tracks.rs` (+0 -1) 📝 `examples/artists.rs` (+0 -2) 📝 `examples/artists_albums.rs` (+0 -2) 📝 `examples/audio_analysis.rs` (+0 -2) 📝 `examples/audio_features.rs` (+0 -2) 📝 `examples/audios_features.rs` (+0 -2) 📝 `examples/blocking/add_to_queue.rs` (+0 -1) 📝 `examples/blocking/artist_top_tracks.rs` (+0 -2) 📝 `examples/blocking/categories.rs` (+0 -3) 📝 `examples/blocking/check_users_saved_shows.rs` (+0 -2) 📝 `examples/blocking/current_playback.rs` (+0 -2) 📝 `examples/blocking/current_playing.rs` (+0 -2) _...and 80 more files_ </details> ### 📄 Description `extern crate` is no longer needed after Rust 2018, so I've removed all of them, using `use` in its place. I also removed some unnecessary crates: * `base64`: not used at all * `env_logger`: not used at all * `url`: not used at all * `itertools`: only used once in `client.rs`, found a cleaner solution to avoid using `iproduct` And other small improvements in `Cargo.toml`. The one thing I don't know how to solve is the `reqwest`-related features. Wouldn't it make sense to just remove these `extern crate`? The `Cargo.toml` will already make sure the correct features for `reqwest` are being used. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:23:57 +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#247
No description provided.