Filter inactive postcodes
This commit is contained in:
parent
4c24f74d6e
commit
68bedf2c36
|
@ -144,6 +144,7 @@ fn build() {
|
||||||
.from_reader(io::stdin());
|
.from_reader(io::stdin());
|
||||||
let entries = csv_reader.deserialize()
|
let entries = csv_reader.deserialize()
|
||||||
.filter_map(|r: Result<Postcode, csv::Error>| r.ok())
|
.filter_map(|r: Result<Postcode, csv::Error>| r.ok())
|
||||||
|
.filter(|full| match full.status { Status::Live => true, _ => false })
|
||||||
.map(|full: Postcode| SmolPostcode::from_postcode(full))
|
.map(|full: Postcode| SmolPostcode::from_postcode(full))
|
||||||
.map(|smol| Entry::new(smol.postcode.to_owned(), SerdeWrapper(smol)));
|
.map(|smol| Entry::new(smol.postcode.to_owned(), SerdeWrapper(smol)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue