From a109940c5d3c3e8d93bdbc6d99e3195fa7567e96 Mon Sep 17 00:00:00 2001 From: Jan-Peter von Hunnius Date: Mon, 16 Jun 2025 16:07:11 +0200 Subject: [PATCH] Fixed warning Exclude prize cars from trash --- src/records.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/records.rs b/src/records.rs index 57f78c3..5c835b6 100644 --- a/src/records.rs +++ b/src/records.rs @@ -18,6 +18,7 @@ use serde_json::Value; use serde::Deserialize; #[derive(Debug, Deserialize)] +#[allow(non_snake_case)] struct Card { cardId: String, locked: bool, @@ -29,6 +30,7 @@ struct Car { only_name: String, year: u16, rq: u8, + prize: bool, guid: String, } #[derive(Debug, Clone)] @@ -103,7 +105,7 @@ fn print_trash() { for my_car in get_my_car_list() { if ! best_cars.contains(&my_car) { for bad_car in get_car_list() { - if bad_car.guid == my_car { + if bad_car.guid == my_car && ! bad_car.prize { println!("{},{},{},{}", bad_car.rq, bad_car.brand, @@ -340,6 +342,7 @@ fn get_car_list() -> Vec { only_name: String::from(car["onlyName"].as_str().unwrap_or("No Name")), year: car["year"].as_u64().unwrap_or(1900) as u16, rq: car["rq"].as_u64().unwrap_or(200) as u8, + prize: car["prize"].as_bool().unwrap_or(false), guid: String::from(car["guid"].as_str().unwrap_or("No GUID")), };