Lints
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 1m2s
Cargo CI / Lint (pull_request) Successful in 43s

This commit is contained in:
Wojciech Kozlowski 2024-02-09 08:55:32 +01:00
parent 46c61ca078
commit e90b541af6
5 changed files with 19 additions and 19 deletions

View File

@ -1,5 +1,5 @@
use std::{
collections::{HashMap, BTreeMap},
collections::{BTreeMap, HashMap},
fmt::{self, Debug, Display},
mem,
};

View File

@ -1,4 +1,4 @@
use std::{cmp::Ordering, iter::Peekable, collections::HashMap, hash::Hash};
use std::{cmp::Ordering, collections::HashMap, hash::Hash, iter::Peekable};
/// A trait for merging two objects. The merge is asymmetric with the left argument considered to be
/// the primary whose properties are to be kept in case of collisions.

View File

@ -124,9 +124,9 @@ impl<LIB, DB> MusicHoard<LIB, DB> {
&mut self,
artist_id: ID,
) -> Result<(), Error> {
Ok(self
.get_artist_mut_or_err(artist_id.as_ref())?
.clear_musicbrainz_url())
self.get_artist_mut_or_err(artist_id.as_ref())?
.clear_musicbrainz_url();
Ok(())
}
pub fn add_to_property<ID: AsRef<ArtistId>, S: AsRef<str> + Into<String>>(
@ -135,9 +135,9 @@ impl<LIB, DB> MusicHoard<LIB, DB> {
property: S,
values: Vec<S>,
) -> Result<(), Error> {
Ok(self
.get_artist_mut_or_err(artist_id.as_ref())?
.add_to_property(property, values))
self.get_artist_mut_or_err(artist_id.as_ref())?
.add_to_property(property, values);
Ok(())
}
pub fn remove_from_property<ID: AsRef<ArtistId>, S: AsRef<str>>(
@ -146,9 +146,9 @@ impl<LIB, DB> MusicHoard<LIB, DB> {
property: S,
values: Vec<S>,
) -> Result<(), Error> {
Ok(self
.get_artist_mut_or_err(artist_id.as_ref())?
.remove_from_property(property, values))
self.get_artist_mut_or_err(artist_id.as_ref())?
.remove_from_property(property, values);
Ok(())
}
pub fn set_property<ID: AsRef<ArtistId>, S: AsRef<str> + Into<String>>(
@ -157,9 +157,9 @@ impl<LIB, DB> MusicHoard<LIB, DB> {
property: S,
values: Vec<S>,
) -> Result<(), Error> {
Ok(self
.get_artist_mut_or_err(artist_id.as_ref())?
.set_property(property, values))
self.get_artist_mut_or_err(artist_id.as_ref())?
.set_property(property, values);
Ok(())
}
pub fn clear_property<ID: AsRef<ArtistId>, S: AsRef<str>>(
@ -167,9 +167,9 @@ impl<LIB, DB> MusicHoard<LIB, DB> {
artist_id: ID,
property: S,
) -> Result<(), Error> {
Ok(self
.get_artist_mut_or_err(artist_id.as_ref())?
.clear_property(property))
self.get_artist_mut_or_err(artist_id.as_ref())?
.clear_property(property);
Ok(())
}
fn sort(collection: &mut [Artist]) {

View File

@ -1,10 +1,10 @@
use std::collections::HashMap;
use musichoard::collection::{
album::{Album, AlbumId},
artist::{Artist, ArtistId, MusicBrainz},
track::{Format, Quality, Track, TrackId},
};
use once_cell::sync::Lazy;
use std::collections::HashMap;
use crate::tests::*;

View File

@ -206,7 +206,7 @@ impl<'a> ArtistOverlay<'a> {
list_indent: &str,
) -> String {
let mut vec: Vec<(&str, &Vec<T>)> = map.iter().map(|(k, v)| (k.as_ref(), v)).collect();
vec.sort_by(|x, y| x.0.cmp(&y.0));
vec.sort_by(|x, y| x.0.cmp(y.0));
let indent = format!("\n{item_indent}");
let list = vec