From: Scott Worley Date: Sun, 7 Apr 2024 12:57:43 +0000 (-0700) Subject: Eliminated candidates UI X-Git-Tag: v0.3.0~2 X-Git-Url: http://git.scottworley.com/voter/commitdiff_plain/82977580a924521c805fb47231bdfaf968923a15?ds=sidebyside Eliminated candidates UI --- 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 = "