X-Git-Url: http://git.scottworley.com/voter/blobdiff_plain/a5a841dea698bd7b61a9ee04bebb3c4a83ab6f71..5ee4072bf723ad5b091bcf8e5869382fed9f00ba:/src/main.rs diff --git a/src/main.rs b/src/main.rs index 8c94be1..92937e5 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 = "