From 68bedf2c36b8f38b1b89a8d952a52d26b7547172 Mon Sep 17 00:00:00 2001 From: Alex Wright Date: Sun, 9 Oct 2022 19:24:05 +0100 Subject: [PATCH] Filter inactive postcodes --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index dd53cf7..7406560 100644 --- a/src/main.rs +++ b/src/main.rs @@ -144,6 +144,7 @@ fn build() { .from_reader(io::stdin()); let entries = csv_reader.deserialize() .filter_map(|r: Result| r.ok()) + .filter(|full| match full.status { Status::Live => true, _ => false }) .map(|full: Postcode| SmolPostcode::from_postcode(full)) .map(|smol| Entry::new(smol.postcode.to_owned(), SerdeWrapper(smol)));