use serdes rename_all

This commit is contained in:
Max Känner 2024-09-30 18:25:59 +02:00
parent 27d60845b5
commit 157ea2aaad

View File

@ -16,18 +16,15 @@ mod logic;
// See https://docs.battlesnake.com/api // See https://docs.battlesnake.com/api
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Deserialize, Serialize, Sequence)] #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Deserialize, Serialize, Sequence)]
#[serde(rename_all = "lowercase")]
pub enum Direction { pub enum Direction {
/// Move left (-x) /// Move left (-x)
#[serde(rename = "left")]
Left, Left,
/// Move up (+y) /// Move up (+y)
#[serde(rename = "up")]
Up, Up,
/// Move right (+x) /// Move right (+x)
#[serde(rename = "right")]
Right, Right,
/// Move down (-y) /// Move down (-y)
#[serde(rename = "down")]
Down, Down,
} }