Skip to content

Commit

Permalink
excel: use safer get() instead of [] for indexed access
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Apr 29, 2023
1 parent 3800d25 commit 252b01e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
sheet: vec![],
};
for (i, sheet_name) in sheet_vec.iter().enumerate() {

let range = if let Some(result) = workbook.worksheet_range_at(i) {
match result {
Ok(result) => result,
Expand Down Expand Up @@ -565,7 +564,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
DataType::Float(ref f) => {
float_val = *f;
float_flag = true;
cell_date_flag = date_flag[col_idx];
cell_date_flag = *date_flag.get(col_idx).unwrap_or(&false);
}
DataType::Error(ref e) => record.push_field(&format!("{e:?}")),
DataType::Bool(ref b) => record.push_field(&b.to_string()),
Expand Down

0 comments on commit 252b01e

Please sign in to comment.