Skip to content

Commit 3b8acd3

Browse files
committed
Add serde renaming directives
1 parent 2900d64 commit 3b8acd3

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

lighthouse-protocol/src/input/event_source.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize};
22

33
/// An identifier that is unique per client + device combo.
44
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
5+
#[serde(untagged)]
56
pub enum EventSource {
67
String(String),
78
Int(i32),

lighthouse-protocol/src/input/gamepad_event.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use super::EventSource;
44

55
/// A gamepad/controller event.
66
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
7+
#[serde(rename_all = "camelCase")]
78
pub struct GamepadEvent {
89
/// The client identifier. Also unique per gamepad.
910
pub source: EventSource,

lighthouse-protocol/src/input/key_event.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use super::EventSource;
44

55
/// A keyboard event.
66
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
7+
#[serde(rename_all = "camelCase")]
78
pub struct KeyEvent {
89
/// The client identifier.
910
pub source: EventSource,

lighthouse-protocol/src/input/mouse_event.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use super::{EventSource, MouseButton};
66

77
/// A mouse event.
88
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
9+
#[serde(rename_all = "camelCase")]
910
pub struct MouseEvent {
1011
/// The client identifier.
1112
pub source: EventSource,

0 commit comments

Comments
 (0)