chore: fix clippy warnings for diesel example
This commit is contained in:
parent
2e4d3b6196
commit
ca5113f1fb
2 changed files with 3 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Reference in a new issue