Skip to content

Commit

Permalink
fix: allow serialization of structs
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Sep 13, 2024
1 parent 85db799 commit 89c2e30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use std::collections::HashMap;

use serde::Deserialize;
use serde::{Deserialize, Serialize};

use crate::system::{System, SystemTweaks};

#[derive(PartialEq, Debug, Deserialize)]
#[derive(PartialEq, Debug, Deserialize, Serialize)]
pub struct TweakSettings {
pub gamemode: Option<bool>,
pub mangohud: Option<bool>,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct Issue {
pub description: String,
pub solution: Option<String>,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct Tweaks {
pub tricks: Vec<String>,
pub env: HashMap<String, String>,
Expand All @@ -25,7 +25,7 @@ pub struct Tweaks {
pub system: System,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct App {
pub id: String,
pub name: String,
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use app::App;
use log::trace;
use reqwest::{StatusCode, Url};
use serde::{de::DeserializeOwned, Deserialize};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

pub mod app;
pub mod system;
Expand All @@ -10,14 +10,14 @@ pub struct Protontweaks {
url: &'static str,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct AppsList {
pub sha: String,
pub short_sha: String,
pub apps: Vec<MicroApp>,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct MicroApp {
pub id: String,
pub name: String,
Expand Down
8 changes: 4 additions & 4 deletions src/system.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use std::collections::HashMap;

use log::info;
use serde::Deserialize;
use serde::{Deserialize, Serialize};

use crate::app::TweakSettings;

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct System {
pub gpu_driver: GpuDriver,
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct GpuDriver {
pub amd: Option<SystemTweaks>,
pub nvidia: Option<SystemTweaks>,
}

#[derive(PartialEq, Debug, Deserialize)]
#[derive(PartialEq, Debug, Deserialize, Serialize)]
pub struct SystemTweaks {
pub tricks: Vec<String>,
pub env: HashMap<String, String>,
Expand Down

0 comments on commit 89c2e30

Please sign in to comment.