From 4848c0cd6146e00828e92b1445c8324a00ae2f7b Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 25 Mar 2025 15:40:24 -0400 Subject: [PATCH] remove num crate --- Cargo.lock | 65 ---------------------------------------------- Cargo.toml | 1 - src/repr/coords.rs | 5 ++-- 3 files changed, 2 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03f3fac..7eb027c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -357,70 +357,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -462,7 +398,6 @@ dependencies = [ "either", "indicatif", "nohash-hasher", - "num", "rand", "rayon", "skillratings", diff --git a/Cargo.toml b/Cargo.toml index f8a16e0..ba4a047 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,6 @@ crossbeam-channel = "0.5" either = "1.13" indicatif = { version = "0.17", features = [ "rayon" ] } nohash-hasher = "0.2" -num = "0.4" rand = "0.9" rayon = "1.10" skillratings = "0.27" diff --git a/src/repr/coords.rs b/src/repr/coords.rs index 063ca56..a7504dc 100644 --- a/src/repr/coords.rs +++ b/src/repr/coords.rs @@ -1,6 +1,5 @@ use super::Board; use allocative::Allocative; -use num::Integer; use static_assertions::const_assert; /// PERF! having `Coord` be of type `u8` (instead of usize) increases @@ -22,8 +21,8 @@ impl CoordPair { } #[allow(clippy::wrong_self_convention)] - fn into_indexes(&self) -> (CoordAxis, CoordAxis) { - self.0.div_mod_floor(&Board::SIZE) + pub const fn into_indexes(&self) -> (CoordAxis, CoordAxis) { + (self.0 / Board::SIZE, self.0 % Board::SIZE) } pub const fn area(pos: CoordAxis) -> Self {