Make exports more explicit
This commit is contained in:
parent
a011adefaa
commit
6178a30353
@ -2,7 +2,7 @@ use once_cell::sync::Lazy;
|
||||
|
||||
use crate::core::{
|
||||
collection::{album::AlbumMonth, track::TrackFormat},
|
||||
library::Item,
|
||||
interface::library::Item,
|
||||
};
|
||||
|
||||
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
|
2
src/core/interface/mod.rs
Normal file
2
src/core/interface/mod.rs
Normal file
@ -0,0 +1,2 @@
|
||||
pub mod database;
|
||||
pub mod library;
|
@ -1,6 +1,5 @@
|
||||
pub mod collection;
|
||||
pub mod database;
|
||||
pub mod library;
|
||||
pub mod interface;
|
||||
pub mod musichoard;
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -6,7 +6,10 @@ pub mod musichoard_builder;
|
||||
|
||||
use std::fmt::{self, Display};
|
||||
|
||||
use crate::core::{collection, database, library};
|
||||
use crate::core::{
|
||||
collection,
|
||||
interface::{database, library},
|
||||
};
|
||||
|
||||
/// Error type for `musichoard`.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
|
@ -8,8 +8,10 @@ use crate::core::{
|
||||
track::{Track, TrackId, TrackNum, TrackQuality},
|
||||
Collection, MergeCollections,
|
||||
},
|
||||
database::IDatabase,
|
||||
library::{ILibrary, Item, Query},
|
||||
interface::{
|
||||
database::IDatabase,
|
||||
library::{ILibrary, Item, Query},
|
||||
},
|
||||
musichoard::Error,
|
||||
};
|
||||
|
||||
@ -468,8 +470,10 @@ mod tests {
|
||||
|
||||
use crate::core::{
|
||||
collection::{artist::ArtistId, musicbrainz::MusicBrainz},
|
||||
database::{self, MockIDatabase},
|
||||
library::{self, testmod::LIBRARY_ITEMS, MockILibrary},
|
||||
interface::{
|
||||
database::{self, MockIDatabase},
|
||||
library::{self, testmod::LIBRARY_ITEMS, MockILibrary},
|
||||
},
|
||||
testmod::{FULL_COLLECTION, LIBRARY_COLLECTION},
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
use crate::{
|
||||
core::{
|
||||
database::IDatabase,
|
||||
library::ILibrary,
|
||||
interface::{database::IDatabase, library::ILibrary},
|
||||
musichoard::musichoard::{MusicHoard, NoDatabase, NoLibrary},
|
||||
},
|
||||
Error,
|
||||
@ -79,7 +78,7 @@ impl<LIB: ILibrary, DB: IDatabase> MusicHoardBuilder<LIB, DB> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::core::{database::NullDatabase, library::NullLibrary};
|
||||
use crate::core::interface::{database::NullDatabase, library::NullLibrary};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
@ -7,7 +7,7 @@ use mockall::automock;
|
||||
|
||||
use crate::core::{
|
||||
collection::Collection,
|
||||
database::{IDatabase, LoadError, SaveError},
|
||||
interface::database::{IDatabase, LoadError, SaveError},
|
||||
};
|
||||
|
||||
use super::serde::{deserialize::DeserializeDatabase, serialize::SerializeDatabase};
|
||||
|
@ -9,7 +9,7 @@ use crate::core::{
|
||||
musicbrainz::MusicBrainz,
|
||||
Collection,
|
||||
},
|
||||
database::LoadError,
|
||||
interface::database::LoadError,
|
||||
};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
@ -5,10 +5,7 @@ pub mod database;
|
||||
pub mod library;
|
||||
|
||||
pub use core::collection;
|
||||
|
||||
// TODO: evaluate the exports and/or how to do them
|
||||
pub use core::database::{IDatabase, NullDatabase};
|
||||
pub use core::library::{Field, ILibrary, Item, NullLibrary, Query};
|
||||
pub use core::interface;
|
||||
|
||||
pub use core::musichoard::{
|
||||
musichoard::{MusicHoard, NoDatabase, NoLibrary},
|
||||
|
@ -8,7 +8,7 @@ use std::{
|
||||
str,
|
||||
};
|
||||
|
||||
use crate::core::library::Error;
|
||||
use crate::core::interface::library::Error;
|
||||
use crate::library::beets::IBeetsLibraryExecutor;
|
||||
|
||||
const BEET_DEFAULT: &str = "beet";
|
||||
|
@ -8,7 +8,7 @@ use mockall::automock;
|
||||
|
||||
use crate::core::{
|
||||
collection::track::TrackFormat,
|
||||
library::{Error, Field, ILibrary, Item, Query},
|
||||
interface::library::{Error, Field, ILibrary, Item, Query},
|
||||
};
|
||||
|
||||
macro_rules! list_format_separator {
|
||||
@ -201,7 +201,7 @@ mod testmod;
|
||||
mod tests {
|
||||
use mockall::predicate;
|
||||
|
||||
use crate::{collection::album::AlbumMonth, core::library::testmod::LIBRARY_ITEMS};
|
||||
use crate::{collection::album::AlbumMonth, core::interface::library::testmod::LIBRARY_ITEMS};
|
||||
|
||||
use super::*;
|
||||
use testmod::LIBRARY_BEETS;
|
||||
|
@ -11,11 +11,15 @@ use structopt::StructOpt;
|
||||
|
||||
use musichoard::{
|
||||
database::json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
interface::{
|
||||
database::{IDatabase, NullDatabase},
|
||||
library::{ILibrary, NullLibrary},
|
||||
},
|
||||
library::beets::{
|
||||
executor::{ssh::BeetsLibrarySshExecutor, BeetsLibraryProcessExecutor},
|
||||
BeetsLibrary,
|
||||
},
|
||||
IDatabase, ILibrary, MusicHoardBuilder, NoDatabase, NoLibrary, NullDatabase, NullLibrary,
|
||||
MusicHoardBuilder, NoDatabase, NoLibrary,
|
||||
};
|
||||
|
||||
use tui::{App, EventChannel, EventHandler, EventListener, Tui, Ui};
|
||||
|
@ -1,4 +1,7 @@
|
||||
use musichoard::{collection::Collection, IDatabase, ILibrary, MusicHoard};
|
||||
use musichoard::{
|
||||
collection::Collection, interface::database::IDatabase, interface::library::ILibrary,
|
||||
MusicHoard,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
@ -6,7 +6,7 @@ use tempfile::NamedTempFile;
|
||||
use musichoard::{
|
||||
collection::{album::AlbumDate, artist::Artist, Collection},
|
||||
database::json::{backend::JsonDatabaseFileBackend, JsonDatabase},
|
||||
IDatabase,
|
||||
interface::database::IDatabase,
|
||||
};
|
||||
|
||||
use crate::testlib::COLLECTION;
|
||||
|
@ -8,8 +8,8 @@ use std::{
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use musichoard::{
|
||||
interface::library::{Field, ILibrary, Item, Query},
|
||||
library::beets::{executor::BeetsLibraryProcessExecutor, BeetsLibrary},
|
||||
Field, ILibrary, Item, Query,
|
||||
};
|
||||
|
||||
use crate::library::testmod::LIBRARY_ITEMS;
|
||||
|
@ -2,7 +2,7 @@ use once_cell::sync::Lazy;
|
||||
|
||||
use musichoard::{
|
||||
collection::{album::AlbumMonth, track::TrackFormat},
|
||||
Item,
|
||||
interface::library::Item,
|
||||
};
|
||||
|
||||
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
|
||||
|
Loading…
Reference in New Issue
Block a user