Skip to content

Commit

Permalink
replace unwrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmicu committed Sep 6, 2024
1 parent 190ad7f commit c02ca64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/valve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,9 @@ impl Valve {
let mut record: Vec<String> = vec![];
for (i, column) in columns.iter().enumerate() {
let cell = row.try_get::<&str, &str>(column).ok().unwrap_or_default();
let colformat = formats.get(i).unwrap();
let colformat = formats.get(i).ok_or(ValveError::DataError(format!(
"Error retrieving ith format for i == {i}"
)))?;
if *colformat != "" {
let formatted_cell = format_cell(&colformat, &format_regex, &cell);
record.push(formatted_cell.to_string());
Expand Down

0 comments on commit c02ca64

Please sign in to comment.