From ca5113f1fbdc539d54136349643884c002423ce2 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 9 Nov 2021 00:49:00 +0300 Subject: [PATCH] chore: fix clippy warnings for diesel example --- examples/diesel/src/db.rs | 3 ++- examples/diesel/src/main.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);