Remove some whitespace

We definitely need a rustfmt config at some point
This commit is contained in:
Elias Schriefer 2021-07-08 15:29:43 +02:00
parent 891f61f046
commit 76bacdca08

View File

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