From 10b5b5ebfea41497fac23d0de3f58ab93ce36c06 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 28 Aug 2024 18:17:54 +0200 Subject: [PATCH] Minor nits --- src/core/interface/musicbrainz/mod.rs | 2 +- src/external/musicbrainz/api/lookup.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/interface/musicbrainz/mod.rs b/src/core/interface/musicbrainz/mod.rs index d8b4f7a..a59a348 100644 --- a/src/core/interface/musicbrainz/mod.rs +++ b/src/core/interface/musicbrainz/mod.rs @@ -22,7 +22,7 @@ pub struct MbidError(String); impl fmt::Display for MbidError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0) + write!(f, "failed to parse a MBID: {}", self.0) } } diff --git a/src/external/musicbrainz/api/lookup.rs b/src/external/musicbrainz/api/lookup.rs index 70968e8..41e4f07 100644 --- a/src/external/musicbrainz/api/lookup.rs +++ b/src/external/musicbrainz/api/lookup.rs @@ -20,15 +20,16 @@ impl MusicBrainzClient { ) -> Result { let mut include: Vec = vec![]; - let mbid: String = request.mbid.uuid().as_hyphenated().to_string(); - if request.release_groups { include.push(String::from("release-groups")); } let include: String = form_urlencoded::byte_serialize(include.join("+").as_bytes()).collect(); - let url = format!("{MB_BASE_URL}/artist/{mbid}?inc={include}"); + let url = format!( + "{MB_BASE_URL}/artist/{mbid}?inc={include}", + mbid = request.mbid.uuid().as_hyphenated() + ); let response: DeserializeLookupArtistResponse = self.http.get(&url)?; Ok(response.into())