From 1f06a1540f46d8087907566d7c6c1ab397c517ec Mon Sep 17 00:00:00 2001 From: Gaspard Culis <79080828+GaspardCulis@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:13:16 +0100 Subject: [PATCH] chore(core): Derive Serialize and Deserialize for `direction` types (#197) When crate's `serde` feature is enabled --- azalea-core/src/direction.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs index b0b8c9603..aa537858a 100755 --- a/azalea-core/src/direction.rs +++ b/azalea-core/src/direction.rs @@ -3,6 +3,7 @@ use azalea_buf::AzBuf; use crate::position::Vec3; #[derive(Clone, Copy, Debug, AzBuf, Default, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub enum Direction { #[default] Down = 0, @@ -63,6 +64,7 @@ impl Direction { // TODO: make azalea_block use this instead of FacingCardinal #[derive(Clone, Copy, Debug, AzBuf, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub enum CardinalDirection { North, South,