File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ pub mod android {
4343 match DATASTORE {
4444 Some ( ref ds) => ds. clone ( ) ,
4545 None => {
46- let db_dir = dirs:: db_path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
46+ let db_dir = dirs:: db_path ( false ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
4747 DATASTORE = Some ( Datastore :: new ( db_dir, false ) ) ;
4848 openDatastore ( )
4949 }
Original file line number Diff line number Diff line change @@ -74,12 +74,13 @@ pub fn get_log_dir() -> Result<PathBuf, ()> {
7474 }
7575}
7676
77- pub fn db_path ( ) -> PathBuf {
77+ pub fn db_path ( testing : bool ) -> PathBuf {
7878 let mut db_path = get_data_dir ( ) . unwrap ( ) ;
79- #[ cfg( debug_assertions) ]
80- db_path. push ( "sqlite-testing.db" ) ;
81- #[ cfg( not( debug_assertions) ) ]
82- db_path. push ( "sqlite.db" ) ;
79+ if testing {
80+ db_path. push ( "sqlite-testing.db" ) ;
81+ } else {
82+ db_path. push ( "sqlite.db" ) ;
83+ }
8384 db_path
8485}
8586
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ fn main() {
4646
4747 let config = config:: create_config ( testing) ;
4848
49- let db_path = dirs:: db_path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
49+ let db_path = dirs:: db_path ( testing ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
5050 info ! ( "Using DB at path {:?}" , db_path) ;
5151
5252 let asset_path = get_asset_path ( ) ;
You can’t perform that action at this time.
0 commit comments