diff --git a/src/lib.rs b/src/lib.rs index d31b071..905a588 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,13 @@ //! //! [ListenBrainz HTTP API]: https://listenbrainz.readthedocs.io/en/production/dev/api/ +#![deny( + missing_docs, + missing_debug_implementations, + unsafe_code, + unstable_features +)] + mod error; pub mod raw; mod wrapper; diff --git a/src/raw/client.rs b/src/raw/client.rs index 47ea73f..b12720d 100644 --- a/src/raw/client.rs +++ b/src/raw/client.rs @@ -18,6 +18,7 @@ const API_ROOT_URL: &str = "https://api.listenbrainz.org/1/"; /// - [`Error::Api`]: the API returned a non-`2XX` status. /// - [`Error::Json`]: the request or response data could not be converted from or into JSON. /// - [`Error::Http`]: there was some other HTTP error while interacting with the API. +#[derive(Debug)] pub struct Client { api_root_url: String, } @@ -30,6 +31,7 @@ impl Client { } } + /// Construct a new client with a custom API URL. pub fn new_with_url(url: &str) -> Self { Self { api_root_url: url.to_string(), diff --git a/src/raw/request.rs b/src/raw/request.rs index 63510f5..8d8e729 100644 --- a/src/raw/request.rs +++ b/src/raw/request.rs @@ -1,5 +1,7 @@ //! Low-level request data models. +#![allow(missing_docs)] + use std::collections::HashMap; use serde::Serialize; diff --git a/src/raw/response.rs b/src/raw/response.rs index b5999d0..e420454 100644 --- a/src/raw/response.rs +++ b/src/raw/response.rs @@ -4,6 +4,8 @@ //! information. See the documentation of the [`RateLimit`] type for more //! details. +#![allow(missing_docs)] + use std::collections::HashMap; use attohttpc::Response; diff --git a/src/wrapper.rs b/src/wrapper.rs index c02f76d..96aee1f 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -7,6 +7,7 @@ use crate::raw::Client; /// Contains a ListenBrainz token and the associated username /// for authentication purposes. +#[derive(Debug)] struct Auth { token: String, user: String, @@ -16,6 +17,7 @@ struct Auth { /// /// As opposed to [`Client`](crate::raw::Client), this aims to be a convenient and high-level /// wrapper of the ListenBrainz API. +#[derive(Debug)] pub struct ListenBrainz { client: Client, auth: Option,