From 83c36c704dbb34509fd2ea00adf0221c6008a4c5 Mon Sep 17 00:00:00 2001 From: CoCoSol007 Date: Wed, 21 Feb 2024 11:54:45 +0100 Subject: [PATCH] fix clippy --- crates/border-wars/src/map/hex.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/border-wars/src/map/hex.rs b/crates/border-wars/src/map/hex.rs index 3edb991..1dc4301 100644 --- a/crates/border-wars/src/map/hex.rs +++ b/crates/border-wars/src/map/hex.rs @@ -235,7 +235,7 @@ impl Iterator for HexSpiral { impl HexPosition { /// Creates a new [HexPosition]. - pub fn new(x: T, y: T) -> Self { + pub const fn new(x: T, y: T) -> Self { Self(x, y) } @@ -262,7 +262,7 @@ impl HexPosition { size.0 * 3f32 .sqrt() - .mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.0)), + .mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.1)), size.1 * (3.0 / 2.0 * T::to_f32(self.1)), ) }