From 96a3eaec841bec98a8b8595ad9ef2f4448563df1 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Fri, 11 Jun 2021 21:22:28 +1000 Subject: [PATCH] Implement --sum-surplus-transfers --- Cargo.lock | 16 ++++++ Cargo.toml | 1 + html/index.html | 27 ++++++---- html/index.js | 31 +++++++++-- src/main.rs | 4 ++ src/stv/mod.rs | 133 ++++++++++++++++++++++++++++++++++++---------- tests/aec.rs | 1 + tests/ers97.rs | 1 + tests/prsa.rs | 1 + tests/scotland.rs | 1 + 10 files changed, 176 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b3ea93..fc8ee1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,12 @@ dependencies = [ "syn", ] +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + [[package]] name = "flate2" version = "1.0.20" @@ -233,6 +239,15 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" @@ -338,6 +353,7 @@ dependencies = [ "flate2", "git-version", "ibig", + "itertools", "js-sys", "num-bigint", "num-rational", diff --git a/Cargo.toml b/Cargo.toml index fc59167..110e3e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ crate-type = ["lib", "cdylib"] derive_more = "0.99.14" git-version = "0.3.4" ibig = "0.3.2" +itertools = "0.10.1" num-traits = "0.2" wasm-bindgen = "0.2.74" diff --git a/html/index.html b/html/index.html index 1d832c2..f01d77c 100644 --- a/html/index.html +++ b/html/index.html @@ -35,7 +35,8 @@