oknozor / musicbrainz_rs

A wrapper around the musicbrainz API
MIT License
38 stars 18 forks source link

Search pagination and scoring #80

Open nappa85 opened 1 year ago

nappa85 commented 1 year ago

My bad for this second PR, but I also think it's better to separate concepts. This PR is kind-of more invasive than the previous, it introduces pagination on search queries and, to not insert a score field in every entity, introduces a SearchEntity wrapper that leverages serde's flatten to be transparent on deserialization.

What I don't really like here is having inner field as public, since its fields are already accessible via Deref and DerefMut. What do you think about it? Maybe an impl<T> Into<T> for SearchEntity<T> would be better?