fixed split packages being possibly null

This commit is contained in:
2025-05-03 00:36:05 +02:00
parent 6e9ec4a4cb
commit 27d4ec0786
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -19,7 +19,7 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]] [[package]]
name = "alhp_api" name = "alhp_api"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"log", "log",
"reqwest", "reqwest",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "alhp_api" name = "alhp_api"
version = "0.1.1" version = "0.1.2"
edition = "2024" edition = "2024"
authors = ["mpuchstein"] authors = ["mpuchstein"]

View File

@@ -50,7 +50,7 @@ pub mod packages {
pub struct Package { pub struct Package {
pub pkgbase: String, pub pkgbase: String,
pub repo: String, pub repo: String,
pub split_packages: Vec<String>, pub split_packages: Option<Vec<String>>,
pub status: PackageStatus, pub status: PackageStatus,
pub skip_reason: Option<String>, pub skip_reason: Option<String>,
pub lto: String, pub lto: String,
@@ -110,7 +110,7 @@ pub mod packages {
StatusCode::OK => { StatusCode::OK => {
let response = response.text()?; let response = response.text()?;
match serde_json::from_str(&response) { match serde_json::from_str(&response) {
Ok(pkgResponse) => Ok(pkgResponse), Ok(pkg_response) => Ok(pkg_response),
Err(e) => { Err(e) => {
error!("Failed to deserialize JSON: {}", e); error!("Failed to deserialize JSON: {}", e);
error!("Response body: {}", response); error!("Response body: {}", response);
@@ -179,7 +179,7 @@ pub mod general {
StatusCode::OK => { StatusCode::OK => {
let response = response.text()?; let response = response.text()?;
match serde_json::from_str(&response) { match serde_json::from_str(&response) {
Ok(genResponse) => Ok(genResponse), Ok(gen_response) => Ok(gen_response),
Err(e) => { Err(e) => {
error!("Failed to deserialize JSON: {}", e); error!("Failed to deserialize JSON: {}", e);
error!("Response body: {}", response); error!("Response body: {}", response);