diff --git a/src/main.rs b/src/main.rs index 1521117..3939b2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,7 @@ async fn main() -> Result<(), Box> { } let mut config = get_config(&options)?; - + if let Some(db_path) = clap_matches.value_of("database_path") { config.database_path = db_path.into(); } @@ -98,14 +98,13 @@ async fn connect_sqlite(path: &PathBuf) -> sqlx::Result { async fn load_sqlite_template(sqlite_handle: &mut SqliteConnection) -> sqlx::Result { sqlx::query(&*format!( "{} {} {} {} {} {}", - include_str!("sqlite/users.sql"), - include_str!("sqlite/security_preferences.sql"), - include_str!("sqlite/privacy_preferences.sql"), - include_str!("sqlite/notification_preferences.sql"), - include_str!("sqlite/external_servers_privacy_preferences.sql"), + include_str!("sqlite/users.sql"), + include_str!("sqlite/security_preferences.sql"), + include_str!("sqlite/privacy_preferences.sql"), + include_str!("sqlite/notification_preferences.sql"), + include_str!("sqlite/external_servers_privacy_preferences.sql"), include_str!("sqlite/external_servers_preferences.sql"), )).execute(sqlite_handle).await - } fn get_config(options: &Options) -> std::io::Result { @@ -115,10 +114,10 @@ fn get_config(options: &Options) -> std::io::Result { let mut config_file = File::open(&options.config)?; let mut config_string = String::new(); config_file.read_to_string(&mut config_string)?; - + toml::from_str(&config_string) .map_err(|err| std::io::Error::new( - std::io::ErrorKind::InvalidData, + std::io::ErrorKind::InvalidData, err ) )