]> Untitled Git - lemmy.git/commitdiff
Fixing clippy expect issue.
authorDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 22:04:58 +0000 (17:04 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 22:04:58 +0000 (17:04 -0500)
server/src/db/mod.rs

index c25a64560a7226452755c06050f74cfd6a01eeaa..fef3ffce5df79b6559bebc8df9098c142e9d9b3f 100644 (file)
@@ -112,7 +112,7 @@ impl<T> MaybeOptional<T> for Option<T> {
 
 pub fn establish_unpooled_connection() -> PgConnection {
   let db_url = Settings::get().get_database_url();
-  PgConnection::establish(&db_url).expect(&format!("Error connecting to {}", db_url))
+  PgConnection::establish(&db_url).unwrap_or_else(|_| panic!("Error connecting to {}", db_url))
 }
 
 #[derive(EnumString, ToString, Debug, Serialize, Deserialize)]