diff --git a/src/bin/update_data.rs b/src/bin/update_data.rs index 910648a..a637020 100644 --- a/src/bin/update_data.rs +++ b/src/bin/update_data.rs @@ -122,12 +122,12 @@ struct WolvesResultUser { requested: String, approved: String, sitename: String, - domain: String + domain: String, } #[derive(Deserialize, Serialize, Debug)] struct WolvesResult { success: i8, - result: Vec + result: Vec, } async fn get_wolves(config: &Config) -> Vec { @@ -137,23 +137,26 @@ async fn get_wolves(config: &Config) -> Vec { if config.wolves_url.is_empty() { return vec![]; } - + // get wolves data let uri = &config.wolves_url; let mut res = surf::post(uri).header("X-AM-Identity", &config.wolves_key).await.unwrap(); - - if let Ok(WolvesResult { success, result }) = res.body_json().await { + + if let Ok(WolvesResult { + success, + result, + }) = res.body_json().await + { if success != 1 { return vec![]; } - return result.iter().map(|wolves| AccountWolves::from(wolves) ).collect::>(); + return result.iter().map(AccountWolves::from).collect::>(); } vec![] } - async fn update_account(db: &Pool, account: &AccountWolves) { sqlx::query_as::<_, AccountWolves>( "