From 67fb3fa54b01501eae63f7cef55291f16092d6ff Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 14 Jan 2024 10:17:04 +0100 Subject: [PATCH] Reuse sorting methods --- src/lib.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 11778a4..971993d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -855,13 +855,8 @@ impl MusicHoard { music_hoard_unique_url_dispatch!(qobuz); fn sort(collection: &mut [Artist]) { - collection.sort_unstable(); - for artist in collection.iter_mut() { - artist.albums.sort_unstable(); - for album in artist.albums.iter_mut() { - album.tracks.sort_unstable(); - } - } + Self::sort_artists(collection); + Self::sort_albums_and_tracks(collection); } fn sort_artists(collection: &mut [Artist]) {