mirror of
https://github.com/pcvolkmer/bzkf-rwdp-check.git
synced 2025-04-19 19:16:51 +00:00
refactor: use filter_map()
This commit is contained in:
parent
5a162bc502
commit
716b666153
@ -41,8 +41,7 @@ impl OpalCsvFile {
|
||||
|
||||
let items = reader
|
||||
.deserialize::<OpalRecord>()
|
||||
.filter(|record| record.is_ok())
|
||||
.map(|record| record.unwrap())
|
||||
.filter_map(|record| record.ok())
|
||||
.map(|record| Record {
|
||||
condition_id: record.cond_id,
|
||||
icd10_code: record.cond_coding_code,
|
||||
@ -57,8 +56,7 @@ impl OpalCsvFile {
|
||||
|
||||
let items = reader
|
||||
.deserialize::<ExportData>()
|
||||
.filter(|record| record.is_ok())
|
||||
.map(|record| record.unwrap())
|
||||
.filter_map(|record| record.ok())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Ok(items)
|
||||
|
Loading…
x
Reference in New Issue
Block a user