format the rust sources and split the functions that pushed over the line

This commit is contained in:
2026-09-21 06:33:23 +03:00
parent 205f68222c
commit 4125d509cc
10 changed files with 611 additions and 326 deletions
+7 -3
View File
@@ -4,8 +4,7 @@ use anyhow::{bail, Context, Result};
use futures_util::StreamExt;
use serde::{Deserialize, Serialize};
const GITEA_LATEST: &str =
"https://git.lashman.live/api/v1/repos/lashman/bytesize/releases/latest";
const GITEA_LATEST: &str = "https://git.lashman.live/api/v1/repos/lashman/bytesize/releases/latest";
/// Everything the updater will fetch has to live under this prefix. The download
/// URL arrives from the frontend, and an unconstrained one there would let
@@ -61,7 +60,12 @@ pub(crate) async fn check_for_update() -> Result<Option<UpdateInfo>> {
.assets
.iter()
.find(|a| a.name.eq_ignore_ascii_case("ByteSize.exe"))
.or_else(|| release.assets.iter().find(|a| a.name.to_lowercase().ends_with(".exe")))
.or_else(|| {
release
.assets
.iter()
.find(|a| a.name.to_lowercase().ends_with(".exe"))
})
.map(|a| a.browser_download_url.clone());
Ok(Some(UpdateInfo {
version: latest,