Skip to content

Commit b958e03

Browse files
author
replydev
committed
Always check if database file exists
1 parent 2d538f2 commit b958e03

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ fn print_title(version: &str){
2323
}
2424

2525
fn init() -> Result<(), ()>{
26-
sodiumoxide::init()
26+
match sodiumoxide::init(){
27+
Err(()) => Err(()),
28+
_=> {
29+
utils::create_db_if_needed();
30+
Ok(())
31+
},
32+
}
2733
}
2834

2935
fn main() {
@@ -33,7 +39,7 @@ fn main() {
3339
match init_result {
3440
Ok(()) => {},
3541
Err(()) => {
36-
println!("Failed to init sodiumoxide");
42+
println!("Failed to init cotp");
3743
return;
3844
}
3945
}

0 commit comments

Comments
 (0)