From 82977580a924521c805fb47231bdfaf968923a15 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 7 Apr 2024 05:57:43 -0700 Subject: [PATCH 1/1] Eliminated candidates UI --- src/main.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8c94be1..1ec9d9c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,6 +81,14 @@ fn tally_votes(dir: &Path) -> std::io::Result>> } } +fn read_elim_list(dir: &Path) -> std::io::Result> { + match std::fs::File::open(dir.join("eliminated")) { + Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(HashSet::new()), + Err(e) => Err(e), + Ok(elimfile) => std::io::BufReader::new(elimfile).lines().collect(), + } +} + fn valid_id_char(c: u8) -> bool { c.is_ascii_alphanumeric() } @@ -121,6 +129,7 @@ const HTML_HEADER: &str = "