Is there a way to remove this unreachable statement:
let db_conn = PgConnection::establish(database_url).unwrap_or_else(|_| {
log_panic!(log, "Error connecting to {}", database_url); // this calls `panic!` under the hood.
unreachable!();
});
Somehow the compiler does not see the panic
invocation and wants should return Connection
etc. If I replace log_panic!
with a normal panic!
it works and unreachable!
can be removed.