Lints
Some checks failed
Cargo CI / Build and Test (pull_request) Failing after 2m3s
Cargo CI / Lint (pull_request) Successful in 1m6s

This commit is contained in:
Wojciech Kozlowski 2025-01-02 11:55:24 +01:00
parent 2c1f6acf09
commit 82c60320dc
6 changed files with 22 additions and 7 deletions

View File

@ -295,7 +295,10 @@ impl AsRef<AlbumId> for AlbumId {
impl AlbumId { impl AlbumId {
pub fn new<S: Into<String>>(name: S) -> AlbumId { pub fn new<S: Into<String>>(name: S) -> AlbumId {
AlbumId { title: name.into(), lib_id: AlbumLibId::None } AlbumId {
title: name.into(),
lib_id: AlbumLibId::None,
}
} }
} }

View File

@ -58,7 +58,7 @@ impl Artist {
} }
fn merge_album_with_lib_id( fn merge_album_with_lib_id(
primary_albums: &mut Vec<Album>, primary_albums: &mut [Album],
mut secondary_album: Album, mut secondary_album: Album,
) -> Option<Album> { ) -> Option<Album> {
if let lib_id @ AlbumLibId::Some(_) | lib_id @ AlbumLibId::Singleton = if let lib_id @ AlbumLibId::Some(_) | lib_id @ AlbumLibId::Singleton =
@ -79,7 +79,7 @@ impl Artist {
} }
fn merge_albums_with_lib_id( fn merge_albums_with_lib_id(
primary_albums: &mut Vec<Album>, primary_albums: &mut [Album],
mut secondary_albums: Vec<Album>, mut secondary_albums: Vec<Album>,
) -> HashMap<String, Vec<Album>> { ) -> HashMap<String, Vec<Album>> {
let mut secondary_without_id = HashMap::<String, Vec<Album>>::new(); let mut secondary_without_id = HashMap::<String, Vec<Album>>::new();

View File

@ -1,6 +1,11 @@
//! Module for interacting with the music library. //! Module for interacting with the music library.
use std::{collections::HashSet, fmt, num::ParseIntError, str::{ParseBoolError, Utf8Error}}; use std::{
collections::HashSet,
fmt,
num::ParseIntError,
str::{ParseBoolError, Utf8Error},
};
#[cfg(test)] #[cfg(test)]
use mockall::automock; use mockall::automock;

View File

@ -1,6 +1,9 @@
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use crate::{collection::album::AlbumLibId, core::{collection::track::TrackFormat, interface::library::Item}}; use crate::{
collection::album::AlbumLibId,
core::{collection::track::TrackFormat, interface::library::Item},
};
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> { pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
vec![ vec![

View File

@ -1,6 +1,7 @@
use musichoard::collection::{ use musichoard::collection::{
album::{ album::{
AlbumDate, AlbumId, AlbumLibId, AlbumMeta, AlbumPrimaryType, AlbumSecondaryType, AlbumSeq, AlbumStatus AlbumDate, AlbumId, AlbumLibId, AlbumMeta, AlbumPrimaryType, AlbumSecondaryType, AlbumSeq,
AlbumStatus,
}, },
artist::ArtistMeta, artist::ArtistMeta,
musicbrainz::{IMusicBrainzRef, MbRefOption}, musicbrainz::{IMusicBrainzRef, MbRefOption},

View File

@ -1,6 +1,9 @@
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use musichoard::{collection::{album::AlbumLibId, track::TrackFormat}, interface::library::Item}; use musichoard::{
collection::{album::AlbumLibId, track::TrackFormat},
interface::library::Item,
};
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> { pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
vec![ vec![