Remove some whitespace
We definitely need a rustfmt config at some point
This commit is contained in:
parent
891f61f046
commit
76bacdca08
17
src/main.rs
17
src/main.rs
@ -68,7 +68,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
|
||||
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<SqliteConnection> {
|
||||
async fn load_sqlite_template(sqlite_handle: &mut SqliteConnection) -> sqlx::Result<SqliteQueryResult> {
|
||||
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<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_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
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user