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
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Deserialize, Serialize, Sequence)]
#[serde(rename_all = "lowercase")]
pub enum Direction {
/// Move left (-x)
#[serde(rename = "left")]
Left,
/// Move up (+y)
#[serde(rename = "up")]
Up,
/// Move right (+x)
#[serde(rename = "right")]
Right,
/// Move down (-y)
#[serde(rename = "down")]
Down,
}