From 2bbf7c86f689e5beb36d324889a2ee8dd48d514a Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Fri, 6 Dec 2024 16:55:36 +0100 Subject: [PATCH] fixed the vector method of the kartesiandirection --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 91b8396..08b3b9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,21 +58,21 @@ enum KartesianDirection { } impl KartesianDirection { - fn vector>(self) -> Kartesian { + pub fn vector>(self) -> Kartesian { const BELOW: i8 = -1; const ON: i8 = 0; const UPPER: i8 = 1; Kartesian:: { x: match self { - Self::TopLeft | Self::Left | Self::BottomLeft => BELOW.into(), - Self::Top | Self::None | Self::Bottom => ON.into(), - Self::TopRight | Self::Right | Self::BottomRight => UPPER.into(), - }, - y: match self { Self::TopLeft | Self::Top | Self::TopRight => BELOW.into(), Self::Left | Self::None | Self::Right => ON.into(), Self::BottomLeft | Self::Bottom | Self::BottomRight => UPPER.into(), }, + y: match self { + Self::TopLeft | Self::Left | Self::BottomLeft => BELOW.into(), + Self::Top | Self::None | Self::Bottom => ON.into(), + Self::TopRight | Self::Right | Self::BottomRight => UPPER.into(), + }, } } }