File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ impl Database {
59
59
}
60
60
61
61
pub fn set_active_database ( & mut self , path : String ) -> Result < ( ) , Box < dyn Error > > {
62
+ let path = match util:: find_sqlite_file ( & path) {
63
+ Ok ( new_path) => new_path,
64
+ Err ( _) => path,
65
+ } ;
62
66
println ! ( "[NAVIGRAPH] Setting active database to {}" , path) ;
63
67
self . close_connection ( ) ;
64
68
if util:: is_sqlite_file ( & path) ? {
Original file line number Diff line number Diff line change @@ -137,10 +137,7 @@ impl<'a> Dispatcher<'a> {
137
137
138
138
fn set_database_if_exists ( & mut self , path : & str ) -> Result < ( ) , Box < dyn Error > > {
139
139
if path_exists ( & Path :: new ( path) ) {
140
- let sqlite_path = navigation_database:: util:: find_sqlite_file ( path) ?;
141
- self . database . set_active_database ( sqlite_path) ?;
142
-
143
- Ok ( ( ) )
140
+ self . database . set_active_database ( path. to_owned ( ) )
144
141
} else {
145
142
Err ( "Path does not exist" . into ( ) )
146
143
}
You can’t perform that action at this time.
0 commit comments