In the output of hyprctl -j devices, .tablets[].belongsTo is an object, which we try to deserialize into the TabletBelongsTo enum. However, this JSON object is just a "flat" object, containing the fields of one of the enum variants, without a tag specifying which variant it is. So we must use #[serde(untagged)] to correctly deserialize it
edit: technically there is a tag: the type field in the parent object:
Fixes #253
In the output of
hyprctl -j devices
,.tablets[].belongsTo
is an object, which we try to deserialize into theTabletBelongsTo
enum. However, this JSON object is just a "flat" object, containing the fields of one of the enum variants, without a tag specifying which variant it is. So we must use#[serde(untagged)]
to correctly deserialize itedit: technically there is a tag: the
type
field in the parent object:Lmk if this solution is acceptable or if should instead take that
type
field into account (practically I don't think there's a difference)