Skip to content

Commit

Permalink
Simplify error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Oct 7, 2024
1 parent 06ae9b2 commit fe7a4c3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use rusqlite::{params, Connection};
use std::{fs::create_dir, path::PathBuf};

pub fn connect() -> Result<Connection> {
let conn = Connection::open(path()?).map_err(|e| {
eprintln!("failed to connect to database: {e}");
e
})?;
let conn = Connection::open(path()?)?;
init(&conn)?;
Ok(conn)
}
Expand Down

0 comments on commit fe7a4c3

Please sign in to comment.