You've already forked flix
Update dependencies and lints
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Collections API
|
||||
//! Collections API.
|
||||
|
||||
use std::rc::Rc;
|
||||
use alloc::sync::Arc;
|
||||
use std::sync::RwLock;
|
||||
|
||||
use crate::api::exec_request;
|
||||
@@ -10,26 +10,38 @@ use crate::{Cache, CachePolicy, Config};
|
||||
|
||||
use super::{Error, make_request};
|
||||
|
||||
/// TMDB Collections API client
|
||||
/// TMDB Collections API client.
|
||||
#[derive(Debug)]
|
||||
pub struct Client {
|
||||
config: Rc<Config>,
|
||||
cache: Rc<dyn Cache>,
|
||||
policy: Rc<RwLock<CachePolicy>>,
|
||||
/// The client configuration.
|
||||
config: Arc<Config>,
|
||||
/// The request cache.
|
||||
cache: Arc<dyn Cache>,
|
||||
/// The cache policy to use for requests.
|
||||
policy: Arc<RwLock<CachePolicy>>,
|
||||
}
|
||||
|
||||
impl Client {
|
||||
/// Create a new client with the given configuration
|
||||
pub fn new(config: Rc<Config>, cache: Rc<dyn Cache>, policy: Rc<RwLock<CachePolicy>>) -> Self {
|
||||
/// Create a new client with the given configuration.
|
||||
#[inline]
|
||||
pub fn new(
|
||||
config: Arc<Config>,
|
||||
cache: Arc<dyn Cache>,
|
||||
policy: Arc<RwLock<CachePolicy>>,
|
||||
) -> Self {
|
||||
Self {
|
||||
config,
|
||||
cache,
|
||||
policy,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Client {
|
||||
/// Fetch the details of the collection refered to by ID
|
||||
/// Fetch the details of the collection refered to by ID.
|
||||
///
|
||||
/// # Errors
|
||||
/// See [Error] for failure modes.
|
||||
#[inline]
|
||||
#[expect(clippy::impl_trait_in_params, reason = "turbofish is not expected")]
|
||||
pub async fn get_details(
|
||||
&self,
|
||||
id: impl Into<CollectionId>,
|
||||
|
||||
Reference in New Issue
Block a user