From 6329f472fcf191bbe9ab543791d97cb0b4fc67d9 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Fri, 3 Jan 2025 09:52:58 +0100 Subject: [PATCH] Minor unrelated fixes --- src/core/collection/album.rs | 11 +---------- src/core/collection/merge.rs | 4 ++-- src/core/musichoard/base.rs | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/core/collection/album.rs b/src/core/collection/album.rs index d8bc3cd..0bb0161 100644 --- a/src/core/collection/album.rs +++ b/src/core/collection/album.rs @@ -1,7 +1,4 @@ -use std::{ - fmt::{self, Display}, - mem, -}; +use std::mem; use crate::core::collection::{ merge::{Merge, MergeName, MergeSorted}, @@ -332,12 +329,6 @@ impl AlbumId { } } -impl Display for AlbumId { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.title) - } -} - #[cfg(test)] mod tests { use crate::core::testmod::FULL_COLLECTION; diff --git a/src/core/collection/merge.rs b/src/core/collection/merge.rs index 51b5b79..bbfc0fe 100644 --- a/src/core/collection/merge.rs +++ b/src/core/collection/merge.rs @@ -91,7 +91,7 @@ pub struct MergeCollections { impl MergeCollections where - T: MergeName + Merge + Ord, + T: MergeName + Merge, IT: IntoIterator)>, { pub fn merge_by_name(primary_items: &mut Vec, secondary: IT) { @@ -102,7 +102,7 @@ where assert_eq!(secondary_items.len(), 1); primary_item.merge_in_place(secondary_items.pop().unwrap()); } - None => primary_items.append(&mut secondary_items), + None => primary_items.extend(secondary_items), } } } diff --git a/src/core/musichoard/base.rs b/src/core/musichoard/base.rs index 32a429c..50c9340 100644 --- a/src/core/musichoard/base.rs +++ b/src/core/musichoard/base.rs @@ -110,7 +110,7 @@ impl IMusicHoardBasePrivate for MusicHoard Self::get_album_mut(artist, album_id).ok_or_else(|| { Error::CollectionError(format!( "album '{}' does not belong to the artist", - album_id + album_id.title )) }) }