Skip to content

Commit

Permalink
feat: Skip invalid lines(i.e.you dont need to delete first lines from…
Browse files Browse the repository at this point in the history
… Exilenece)
  • Loading branch information
shonya3 committed Apr 11, 2023
1 parent f3c4911 commit 24a61e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src-tauri/lib/src/types/record/csv/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ pub fn read(content_string: &str, minimum_card_price: Option<f32>) -> Result<Vec

let mut records: Vec<Record> = vec![];
for record in reader.deserialize::<Record>() {
let record = record?;

if record.calculated.unwrap_or_default() >= minimum_card_price.unwrap_or_default() {
records.push(record);
if let Ok(record) = record {
if record.calculated.unwrap_or_default() >= minimum_card_price.unwrap_or_default() {
records.push(record);
}
}
}

Ok(records)
}

Expand Down

0 comments on commit 24a61e1

Please sign in to comment.