I was experimenting with using your tool as a lib, and I encountered something that was not clear to me from reading the docs:
let track = Track::new("6QLADdXYMjNHBLr8a9WE7y").expect("Failed to create track");
It failed, in the docs it was just written the argument to new is called track: &str.
Since I was not familiar with the spotify notation of "uris", I failed.
When writing it worked.
Track::new("spotify:track:6QLADdXYMjNHBLr8a9WE7y")
So instead of accepting a &str I would suggest to accept only a new type called TrackUri that would guide the user to prefix the track id with spotify:track: and can only be instantiated via TryFrom or a new that returns a result.
I was experimenting with using your tool as a lib, and I encountered something that was not clear to me from reading the docs:
It failed, in the docs it was just written the argument to
newis calledtrack: &str.Since I was not familiar with the spotify notation of "uris", I failed.
When writing it worked.
So instead of accepting a
&strI would suggest to accept only a new type calledTrackUrithat would guide the user to prefix the track id withspotify:track:and can only be instantiated viaTryFromor a new that returns a result.