Edit for readability

This commit is contained in:
Elias Schriefer 2021-06-20 17:39:47 +00:00
parent e68fc11e43
commit caf9bd299a

View File

@ -46,8 +46,9 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut config = get_config(&options)?; let mut config = get_config(&options)?;
clap_matches.value_of("database_path") if let Some(db_path) = clap_matches.value_of("database_path") {
.map(|x| config.database_path = x.into()); config.database_path = db_path.into();
}
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
println!("{:?}", options); println!("{:?}", options);
@ -64,7 +65,6 @@ async fn connect_sqlite(path: &PathBuf) -> sqlx::Result<SqliteConnection> {
SqliteConnection::connect_with(&connect_options).await SqliteConnection::connect_with(&connect_options).await
} }
///
fn get_config(options: &Options) -> std::io::Result<Config> { fn get_config(options: &Options) -> std::io::Result<Config> {
let mut config_file = File::open(&options.config)?; let mut config_file = File::open(&options.config)?;
let mut config_string = String::new(); let mut config_string = String::new();