Split lib.rs into smaller files #115
@ -66,7 +66,7 @@ mod tests {
|
|||||||
|
|
||||||
use mockall::predicate;
|
use mockall::predicate;
|
||||||
|
|
||||||
use crate::{musichoard::testmod::FULL_COLLECTION, Artist, ArtistId, Collection};
|
use crate::{core::musichoard::testmod::FULL_COLLECTION, Artist, ArtistId, Collection};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use testmod::DATABASE_JSON;
|
use testmod::DATABASE_JSON;
|
@ -4,7 +4,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use mockall::automock;
|
use mockall::automock;
|
||||||
|
|
||||||
use crate::collection::track::Format;
|
use crate::core::collection::track::Format;
|
||||||
|
|
||||||
use super::{Error, Field, ILibrary, Item, Query};
|
use super::{Error, Field, ILibrary, Item, Query};
|
||||||
|
|
@ -5,7 +5,7 @@ use std::{collections::HashSet, fmt, num::ParseIntError, str::Utf8Error};
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use mockall::automock;
|
use mockall::automock;
|
||||||
|
|
||||||
use crate::collection::track::Format;
|
use crate::core::collection::track::Format;
|
||||||
|
|
||||||
#[cfg(feature = "library-beets")]
|
#[cfg(feature = "library-beets")]
|
||||||
pub mod beets;
|
pub mod beets;
|
@ -1,6 +1,6 @@
|
|||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|
||||||
use crate::{collection::track::Format, library::Item};
|
use crate::{library::Item, Format};
|
||||||
|
|
||||||
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
|
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
|
||||||
vec![
|
vec![
|
4
src/core/mod.rs
Normal file
4
src/core/mod.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
pub mod collection;
|
||||||
|
pub mod database;
|
||||||
|
pub mod library;
|
||||||
|
pub mod musichoard;
|
@ -1,4 +1,4 @@
|
|||||||
use crate::collection::{
|
use crate::core::collection::{
|
||||||
album::{Album, AlbumId},
|
album::{Album, AlbumId},
|
||||||
artist::{Artist, ArtistId, ArtistProperties, Bandcamp, MusicBrainz, MusicButler, Qobuz},
|
artist::{Artist, ArtistId, ArtistProperties, Bandcamp, MusicBrainz, MusicButler, Qobuz},
|
||||||
track::{Format, Quality, Track, TrackId},
|
track::{Format, Quality, Track, TrackId},
|
@ -5,7 +5,7 @@ use super::*;
|
|||||||
use super::testmod::{FULL_COLLECTION, LIBRARY_COLLECTION};
|
use super::testmod::{FULL_COLLECTION, LIBRARY_COLLECTION};
|
||||||
|
|
||||||
// FIXME: check all crate::* imports - are the tests where they should be?
|
// FIXME: check all crate::* imports - are the tests where they should be?
|
||||||
use crate::collection::{
|
use crate::core::collection::{
|
||||||
artist::{ArtistProperties, Bandcamp, MusicBrainz, MusicButler, Qobuz},
|
artist::{ArtistProperties, Bandcamp, MusicBrainz, MusicButler, Qobuz},
|
||||||
track::Format,
|
track::Format,
|
||||||
Merge,
|
Merge,
|
21
src/lib.rs
21
src/lib.rs
@ -1,26 +1,27 @@
|
|||||||
//! MusicHoard - a music collection manager.
|
//! MusicHoard - a music collection manager.
|
||||||
|
|
||||||
mod collection;
|
// FIXME: make private and only provide via re-exports.
|
||||||
mod musichoard;
|
pub mod core;
|
||||||
|
|
||||||
// FIXME: make private and fix via re-exports.
|
|
||||||
pub mod database;
|
|
||||||
pub mod library;
|
|
||||||
|
|
||||||
use std::fmt::{self, Display};
|
use std::fmt::{self, Display};
|
||||||
|
|
||||||
use collection::artist::InvalidUrlError;
|
// FIXME: validate the re-exports.
|
||||||
|
pub use core::database;
|
||||||
|
pub use core::library;
|
||||||
|
|
||||||
// FIXME: validate the re-exports.
|
// FIXME: validate the re-exports.
|
||||||
pub use collection::{
|
pub use core::collection::{
|
||||||
album::{Album, AlbumId},
|
album::{Album, AlbumId},
|
||||||
artist::{Artist, ArtistId, ArtistProperties, Bandcamp, MusicBrainz, MusicButler, Qobuz},
|
artist::{
|
||||||
|
Artist, ArtistId, ArtistProperties, Bandcamp, InvalidUrlError, MusicBrainz, MusicButler,
|
||||||
|
Qobuz,
|
||||||
|
},
|
||||||
track::{Format, Quality, Track, TrackId},
|
track::{Format, Quality, Track, TrackId},
|
||||||
Collection,
|
Collection,
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: validate the re-exports
|
// FIXME: validate the re-exports
|
||||||
pub use musichoard::{MusicHoard, MusicHoardBuilder, NoDatabase, NoLibrary};
|
pub use core::musichoard::{MusicHoard, MusicHoardBuilder, NoDatabase, NoLibrary};
|
||||||
|
|
||||||
// FIXME: this should be in the musichoard module.
|
// FIXME: this should be in the musichoard module.
|
||||||
/// Error type for `musichoard`.
|
/// Error type for `musichoard`.
|
||||||
|
Loading…
Reference in New Issue
Block a user