This commit is contained in:
Wojciech Kozlowski 2023-04-13 15:08:20 +02:00
parent 23d4aba09f
commit f58ffb036a

View File

@ -56,15 +56,15 @@ pub trait CollectionManager {
/// The collection manager. It is responsible for pulling information from both the library and the
/// database, ensuring its consistent and writing back any changes.
pub struct MhCollectionManager<L, D> {
library: L,
database: D,
pub struct MhCollectionManager<LIB, DB> {
library: LIB,
database: DB,
collection: Collection,
}
impl<L: Library, D: Database> MhCollectionManager<L, D> {
impl<LIB: Library, DB: Database> MhCollectionManager<LIB, DB> {
/// Create a new [`CollectionManager`] with the provided [`Library`] and [`Database`].
pub fn new(library: L, database: D) -> Self {
pub fn new(library: LIB, database: DB) -> Self {
MhCollectionManager {
library,
database,
@ -73,7 +73,7 @@ impl<L: Library, D: Database> MhCollectionManager<L, D> {
}
}
impl<L: Library, D: Database> CollectionManager for MhCollectionManager<L, D> {
impl<LIB: Library, DB: Database> CollectionManager for MhCollectionManager<LIB, DB> {
fn rescan_library(&mut self) -> Result<(), Error> {
self.collection = self.library.list(&Query::default())?;
Ok(())