Minor unrelated fixes
This commit is contained in:
parent
36106a2c83
commit
6329f472fc
@ -1,7 +1,4 @@
|
|||||||
use std::{
|
use std::mem;
|
||||||
fmt::{self, Display},
|
|
||||||
mem,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::core::collection::{
|
use crate::core::collection::{
|
||||||
merge::{Merge, MergeName, MergeSorted},
|
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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::core::testmod::FULL_COLLECTION;
|
use crate::core::testmod::FULL_COLLECTION;
|
||||||
|
@ -91,7 +91,7 @@ pub struct MergeCollections<T, IT> {
|
|||||||
|
|
||||||
impl<T, IT> MergeCollections<T, IT>
|
impl<T, IT> MergeCollections<T, IT>
|
||||||
where
|
where
|
||||||
T: MergeName + Merge + Ord,
|
T: MergeName + Merge,
|
||||||
IT: IntoIterator<Item = (String, Vec<T>)>,
|
IT: IntoIterator<Item = (String, Vec<T>)>,
|
||||||
{
|
{
|
||||||
pub fn merge_by_name(primary_items: &mut Vec<T>, secondary: IT) {
|
pub fn merge_by_name(primary_items: &mut Vec<T>, secondary: IT) {
|
||||||
@ -102,7 +102,7 @@ where
|
|||||||
assert_eq!(secondary_items.len(), 1);
|
assert_eq!(secondary_items.len(), 1);
|
||||||
primary_item.merge_in_place(secondary_items.pop().unwrap());
|
primary_item.merge_in_place(secondary_items.pop().unwrap());
|
||||||
}
|
}
|
||||||
None => primary_items.append(&mut secondary_items),
|
None => primary_items.extend(secondary_items),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ impl<Database, Library> IMusicHoardBasePrivate for MusicHoard<Database, Library>
|
|||||||
Self::get_album_mut(artist, album_id).ok_or_else(|| {
|
Self::get_album_mut(artist, album_id).ok_or_else(|| {
|
||||||
Error::CollectionError(format!(
|
Error::CollectionError(format!(
|
||||||
"album '{}' does not belong to the artist",
|
"album '{}' does not belong to the artist",
|
||||||
album_id
|
album_id.title
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user