diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -9,7 +9,7 @@ use std::path::Path; | |||
9 | 9 | ||
10 | pub fn open_connection<P>(p: P) -> Result<Connection> | 10 | pub fn open_connection<P>(p: P) -> Result<Connection> |
11 | where | 11 | where |
12 | P: AsRef<Path> + fmt::Display, | 12 | P: AsRef<Path>, |
13 | { | 13 | { |
14 | info!("Opened connection to database"); | 14 | info!("Opened connection to database"); |
15 | Ok(Connection::open_with_flags( | 15 | Ok(Connection::open_with_flags( |
@@ -18,8 +18,8 @@ where | |||
18 | )?) | 18 | )?) |
19 | } | 19 | } |
20 | 20 | ||
21 | pub fn init_db<P: AsRef<Path> + fmt::Display>(p: P) -> Result<()> { | 21 | pub fn init_db<P: AsRef<Path> + fmt::Debug>(p: P) -> Result<()> { |
22 | debug!("Looking for database at `{}`", p); | 22 | debug!("Looking for database at `{:?}`", p); |
23 | let conn = open_connection(&p)?; | 23 | let conn = open_connection(&p)?; |
24 | conn.execute( | 24 | conn.execute( |
25 | "CREATE TABLE IF NOT EXISTS urls ( | 25 | "CREATE TABLE IF NOT EXISTS urls ( |
@@ -28,6 +28,6 @@ pub fn init_db<P: AsRef<Path> + fmt::Display>(p: P) -> Result<()> { | |||
28 | )", | 28 | )", |
29 | NO_PARAMS, | 29 | NO_PARAMS, |
30 | )?; | 30 | )?; |
31 | info!("SQLite3 database `{}` initialized", &p); | 31 | info!("SQLite3 database `{:?}` initialized", &p); |
32 | Ok(()) | 32 | Ok(()) |
33 | } | 33 | } |