From e8f6a90d0f526619b7aabd187291ca6709723df5 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sun, 24 Nov 2024 19:04:35 +0100 Subject: [PATCH] geometry: style++ --- src/geometry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometry.rs b/src/geometry.rs index 912a1ed..6615cf2 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -32,13 +32,13 @@ pub trait CoordLimits: PartialOrd + PartialEq + Sub + Clone + Mul + Copy + One + impl CoordLimits for u8 { type Data = u8; + const MIN: u8 = 0; + const MAX: u8 = 255; fn distance(x1: Self, y1: Self, x2: Self, y2: Self) -> Self { (max(x2, x1) - min(x2, x1)).saturating_add(max(y2, y1) - min(y2, y1)) //(pow(x2 as u16 - x1 as u16, 2) + pow(y2 as u16 - y1 as u16, 2)).sqrt() as u8 } - const MIN: u8 = 0; - const MAX: u8 = 255; } impl CoordLimits for u16 {