diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-11-28 19:29:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 19:29:32 +0100 |
commit | 179474d2c2a09abaa8806b9da791121b6a5ca082 (patch) | |
tree | 5c311959e9ef20ee30b00eba6cc612911d9ff7d9 /src-tauri/src/github | |
parent | c52a78c2687a308187f6ee2fa3ff67486ac7d324 (diff) | |
download | FlightCore-179474d2c2a09abaa8806b9da791121b6a5ca082.tar.gz FlightCore-179474d2c2a09abaa8806b9da791121b6a5ca082.zip |
style: Auto-format all Rust code (#84)
Diffstat (limited to 'src-tauri/src/github')
-rw-r--r-- | src-tauri/src/github/release_notes.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src-tauri/src/github/release_notes.rs b/src-tauri/src/github/release_notes.rs index f5389d77..69669244 100644 --- a/src-tauri/src/github/release_notes.rs +++ b/src-tauri/src/github/release_notes.rs @@ -1,11 +1,11 @@ -use std::vec::Vec; use serde::{Deserialize, Serialize}; +use std::vec::Vec; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ReleaseInfo { pub name: String, pub published_at: String, - pub body: String + pub body: String, } // Fetches repo release API and returns response as string @@ -55,7 +55,6 @@ pub async fn check_is_flightcore_outdated() -> Result<bool, String> { Ok(version != newest_release_version) } - #[tauri::command] pub async fn get_northstar_release_notes() -> Result<Vec<ReleaseInfo>, String> { let url = "https://api.github.com/repos/R2Northstar/Northstar/releases"; @@ -65,20 +64,24 @@ pub async fn get_northstar_release_notes() -> Result<Vec<ReleaseInfo>, String> { serde_json::from_str(&res).expect("JSON was not well-formatted"); println!("Done checking GitHub API"); - return Ok( - json_response.iter().map(|release| ReleaseInfo { - name: release.get("name") + return Ok(json_response + .iter() + .map(|release| ReleaseInfo { + name: release + .get("name") .and_then(|value| value.as_str()) .unwrap() .to_string(), - published_at: release.get("published_at") + published_at: release + .get("published_at") .and_then(|value| value.as_str()) .unwrap() .to_string(), - body: release.get("body") + body: release + .get("body") .and_then(|value| value.as_str()) .unwrap() .to_string(), - }).collect() - ); + }) + .collect()); } |