Distinguish NoLibrary/NoDatabase from EmptyLibrary/EmptyDatabase #97
@ -158,7 +158,7 @@ fn main() {
|
|||||||
|
|
||||||
let db = JsonDatabase::new(JsonDatabaseFileBackend::new(&opt.database_file_path));
|
let db = JsonDatabase::new(JsonDatabaseFileBackend::new(&opt.database_file_path));
|
||||||
|
|
||||||
let mut music_hoard = MusicHoardBuilder::new().set_database(db).build();
|
let mut music_hoard = MusicHoardBuilder::default().set_database(db).build();
|
||||||
music_hoard
|
music_hoard
|
||||||
.load_from_database()
|
.load_from_database()
|
||||||
.expect("failed to load database");
|
.expect("failed to load database");
|
||||||
|
@ -85,7 +85,7 @@ fn with_database<DB: IDatabase>(opt: Opt, builder: MusicHoardBuilder<NoLibrary,
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let opt = Opt::from_args();
|
let opt = Opt::from_args();
|
||||||
let builder = MusicHoardBuilder::new();
|
let builder = MusicHoardBuilder::default();
|
||||||
|
|
||||||
if opt.no_database {
|
if opt.no_database {
|
||||||
with_database(opt, builder.set_database(NullDatabase));
|
with_database(opt, builder.set_database(NullDatabase));
|
||||||
|
Loading…
Reference in New Issue
Block a user