1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use super::Endpoint;
use crate::Error;
use reqwest::Url;

pub struct CommunityRating;

impl<'de> Endpoint<'de> for CommunityRating {
    type Parameters = isize;
    type ReturnType = crate::data_types::ReleaseRating;

    fn build_url(base: &Url, params: Self::Parameters) -> Result<Url, Error> {
        base.join(&format!("/releases/{params}/rating"))
            .map_err(|_| Error::UrlError)
    }
}

#[cfg(test)]
mod tests {
    use super::CommunityRating;

    #[test]
    fn basic() {
        let id = 27651927;
        let _data = crate::Client::builder()
            .build()
            .unwrap()
            .get::<CommunityRating>(id)
            .unwrap();
    }
}