Remove unused struct fields from sway JSON objects

Some of these attributes seem to be missing in certain situations, so it's easier to just not parse them at all instead of trying to figure out which of these are optional and when.
This commit is contained in:
Benjamin Bädorf 2021-01-20 22:50:44 +01:00
parent 1e7042f195
commit 8625f0f2c9
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C

View file

@ -17,7 +17,6 @@ struct SwayScreenRect {
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
struct SwayWorkspace { struct SwayWorkspace {
id: usize,
name: String, name: String,
focus: Vec<usize>, focus: Vec<usize>,
output: String, output: String,
@ -25,9 +24,6 @@ struct SwayWorkspace {
rect: SwayScreenRect, rect: SwayScreenRect,
visible: bool, visible: bool,
num: usize, num: usize,
#[serde(rename = "type")]
type_name: String,
representation: String,
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
@ -39,18 +35,9 @@ struct SwayOutputMode {
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
struct SwayOutput { struct SwayOutput {
id: usize,
name: String, name: String,
rect: SwayScreenRect, rect: SwayScreenRect,
layout: String,
orientation: String,
#[serde(rename = "type")]
type_name: String,
make: String,
model: String,
serial: String,
current_mode: SwayOutputMode, current_mode: SwayOutputMode,
focused: bool,
} }
#[derive(Copy, Clone, Hash, Eq, Debug)] #[derive(Copy, Clone, Hash, Eq, Debug)]