get rid of uneccessary expects/unwraps in open_upend; logging

This commit is contained in:
Tomáš Mládek 2021-04-19 00:34:01 +02:00
parent fedf417787
commit c2705d328d

View file

@ -713,16 +713,19 @@ pub fn open_upend<P: AsRef<Path>>(dirpath: P, reinitialize: bool) -> Result<Open
enable_foreign_keys: true, enable_foreign_keys: true,
busy_timeout: Some(Duration::from_secs(30)), busy_timeout: Some(Duration::from_secs(30)),
})) }))
.build(manager) .build(manager)?;
.expect("Failed to create pool.");
trace!("Pool created, running migrations...");
embedded_migrations::run_with_output( embedded_migrations::run_with_output(
&pool.get().unwrap(), &pool.get()?,
&mut LoggerSink { &mut LoggerSink {
..Default::default() ..Default::default()
}, },
)?; )?;
trace!("Initializing types...");
initialize_types(&pool)?; initialize_types(&pool)?;
Ok(OpenResult { pool, new }) Ok(OpenResult { pool, new })