FIX: Make Clippy happy

Automatic fixes
This commit is contained in:
Nicolás Hatcher
2025-01-18 20:04:21 +01:00
committed by Nicolás Hatcher Andrés
parent 263bab2cf9
commit 1b7389fd23
3 changed files with 4 additions and 16 deletions

View File

@@ -188,10 +188,7 @@ impl Model {
node: &Node, node: &Node,
cell: CellReferenceIndex, cell: CellReferenceIndex,
) -> Result<(f64, f64, Suffix), CalcResult> { ) -> Result<(f64, f64, Suffix), CalcResult> {
let value = match self.get_string(node, cell) { let value = self.get_string(node, cell)?;
Ok(s) => s,
Err(s) => return Err(s),
};
if value.is_empty() { if value.is_empty() {
return Ok((0.0, 0.0, Suffix::I)); return Ok((0.0, 0.0, Suffix::I));
} }

View File

@@ -14,14 +14,8 @@ use super::financial_util::{compute_irr, compute_npv, compute_rate, compute_xirr
// https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/scaddins/source/analysis/financial.cxx // https://github.com/apache/openoffice/blob/c014b5f2b55cff8d4b0c952d5c16d62ecde09ca1/main/scaddins/source/analysis/financial.cxx
fn is_less_than_one_year(start_date: i64, end_date: i64) -> Result<bool, String> { fn is_less_than_one_year(start_date: i64, end_date: i64) -> Result<bool, String> {
let end = match from_excel_date(end_date) { let end = from_excel_date(end_date)?;
Ok(s) => s, let start = from_excel_date(start_date)?;
Err(s) => return Err(s),
};
let start = match from_excel_date(start_date) {
Ok(s) => s,
Err(s) => return Err(s),
};
if end_date - start_date < 365 { if end_date - start_date < 365 {
return Ok(true); return Ok(true);
} }

View File

@@ -960,10 +960,7 @@ impl Model {
} }
} }
} }
let sheet = match self.get_sheet_index_by_name(&sheet_name) { let sheet = self.get_sheet_index_by_name(&sheet_name)?;
Some(s) => s,
None => return None,
};
let row = match row.parse::<i32>() { let row = match row.parse::<i32>() {
Ok(r) => r, Ok(r) => r,
Err(_) => return None, Err(_) => return None,