From 008a8f73e6c67b1fecf78e7421c5c20ae4ee0e0a Mon Sep 17 00:00:00 2001 From: CoCoSol007 Date: Fri, 16 Feb 2024 00:58:24 +0100 Subject: [PATCH] fix fmt --- crates/border-wars/src/map/hex.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/border-wars/src/map/hex.rs b/crates/border-wars/src/map/hex.rs index 8cb56c8..93616f2 100644 --- a/crates/border-wars/src/map/hex.rs +++ b/crates/border-wars/src/map/hex.rs @@ -1,11 +1,11 @@ //! All functions related to calculations in a hexagonal grid. - use std::ops::{ Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign, }; -use num::{cast::AsPrimitive, FromPrimitive}; +use num::cast::AsPrimitive; +use num::FromPrimitive; use paste::paste; /// Represents a number that can be used in calculations for hexagonal grids. @@ -164,7 +164,7 @@ pub struct HexSpiral { index: usize, } -impl+ FromPrimitive> Iterator for HexSpiral { +impl + FromPrimitive> Iterator for HexSpiral { type Item = HexPosition; fn next(&mut self) -> Option { @@ -183,11 +183,9 @@ impl+ FromPrimitive> Iterator for HexSpiral { } result } - } - -impl+ FromPrimitive> HexPosition { +impl + FromPrimitive> HexPosition { /// Creates a new hexagonal position. pub fn new(x: T, y: T) -> Self { Self(x, y) @@ -256,7 +254,6 @@ macro_rules! impl_ops { )*}}; } - impl_ops! { (Add, add), (Sub, sub),