diff --git a/examples/diesel/src/db.rs b/examples/diesel/src/db.rs index a40f4bc..03dc049 100644 --- a/examples/diesel/src/db.rs +++ b/examples/diesel/src/db.rs @@ -4,5 +4,6 @@ use diesel::prelude::*; pub fn establish_connection() -> PgConnection { let database_url = config::DATABASE_URL(); - PgConnection::establish(database_url).expect(&format!("Error connecting to {}", database_url)) + PgConnection::establish(database_url) + .unwrap_or_else(|_| panic!("Error connecting to {}", database_url)) } diff --git a/examples/diesel/src/main.rs b/examples/diesel/src/main.rs index d8044dc..9f9123b 100644 --- a/examples/diesel/src/main.rs +++ b/examples/diesel/src/main.rs @@ -23,7 +23,7 @@ fn main() { println!("Displaying {} posts", posts.len()); for post in posts { - print!("\n"); + println!(); println!("{}", post.title); println!("----------"); println!("{}", post.body);