From a6ed6857d25e0eff8fd16bf14d17f5e2be6bf644 Mon Sep 17 00:00:00 2001 From: johannesd3 Date: Wed, 10 Feb 2021 23:03:33 +0100 Subject: [PATCH] Clean up dependencies in librespot-metadata * Replaced LinearMap by HashMap * Removed unnecessary dependencies * Removed "extern crate"s --- Cargo.lock | 8 -------- metadata/Cargo.toml | 2 -- metadata/src/lib.rs | 18 ++++++------------ 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fe8387d..94aea40b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1485,10 +1485,8 @@ version = "0.1.6" dependencies = [ "async-trait", "byteorder", - "futures", "librespot-core", "librespot-protocol", - "linear-map", "log", "protobuf", ] @@ -1542,12 +1540,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "linear-map" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" - [[package]] name = "lock_api" version = "0.4.2" diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index 6baae5d9..f3087b8a 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -10,8 +10,6 @@ edition = "2018" [dependencies] async-trait = "0.1" byteorder = "1.3" -futures = "0.3" -linear-map = "1.2" protobuf = "~2.14.0" log = "0.4" diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index f71bae95..8faa027e 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -1,26 +1,20 @@ #![allow(clippy::unused_io_amount)] #![allow(clippy::redundant_field_names)] + #[macro_use] extern crate log; #[macro_use] extern crate async_trait; -extern crate byteorder; -extern crate futures; -extern crate linear_map; -extern crate protobuf; - -extern crate librespot_core; -extern crate librespot_protocol as protocol; - pub mod cover; -use linear_map::LinearMap; +use std::collections::HashMap; use librespot_core::mercury::MercuryError; use librespot_core::session::Session; use librespot_core::spotify_id::{FileId, SpotifyAudioType, SpotifyId}; +use librespot_protocol as protocol; pub use crate::protocol::metadata::AudioFile_Format as FileFormat; @@ -64,7 +58,7 @@ where pub struct AudioItem { pub id: SpotifyId, pub uri: String, - pub files: LinearMap, + pub files: HashMap, pub name: String, pub duration: i32, pub available: bool, @@ -143,7 +137,7 @@ pub struct Track { pub duration: i32, pub album: SpotifyId, pub artists: Vec, - pub files: LinearMap, + pub files: HashMap, pub alternatives: Vec, pub available: bool, } @@ -165,7 +159,7 @@ pub struct Episode { pub duration: i32, pub language: String, pub show: SpotifyId, - pub files: LinearMap, + pub files: HashMap, pub covers: Vec, pub available: bool, pub explicit: bool,