Skip to content

Commit

Permalink
Clean up dependencies in librespot-metadata
Browse files Browse the repository at this point in the history
* Replaced LinearMap by HashMap
* Removed unnecessary dependencies
* Removed "extern crate"s
  • Loading branch information
Johannesd3 committed Feb 23, 2021
1 parent 10827bd commit a6ed685
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
18 changes: 6 additions & 12 deletions metadata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -64,7 +58,7 @@ where
pub struct AudioItem {
pub id: SpotifyId,
pub uri: String,
pub files: LinearMap<FileFormat, FileId>,
pub files: HashMap<FileFormat, FileId>,
pub name: String,
pub duration: i32,
pub available: bool,
Expand Down Expand Up @@ -143,7 +137,7 @@ pub struct Track {
pub duration: i32,
pub album: SpotifyId,
pub artists: Vec<SpotifyId>,
pub files: LinearMap<FileFormat, FileId>,
pub files: HashMap<FileFormat, FileId>,
pub alternatives: Vec<SpotifyId>,
pub available: bool,
}
Expand All @@ -165,7 +159,7 @@ pub struct Episode {
pub duration: i32,
pub language: String,
pub show: SpotifyId,
pub files: LinearMap<FileFormat, FileId>,
pub files: HashMap<FileFormat, FileId>,
pub covers: Vec<FileId>,
pub available: bool,
pub explicit: bool,
Expand Down

0 comments on commit a6ed685

Please sign in to comment.