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,
cell: CellReferenceIndex,
) -> Result<(f64, f64, Suffix), CalcResult> {
let value = match self.get_string(node, cell) {
Ok(s) => s,
Err(s) => return Err(s),
};
let value = self.get_string(node, cell)?;
if value.is_empty() {
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
fn is_less_than_one_year(start_date: i64, end_date: i64) -> Result<bool, String> {
let end = match from_excel_date(end_date) {
Ok(s) => s,
Err(s) => return Err(s),
};
let start = match from_excel_date(start_date) {
Ok(s) => s,
Err(s) => return Err(s),
};
let end = from_excel_date(end_date)?;
let start = from_excel_date(start_date)?;
if end_date - start_date < 365 {
return Ok(true);
}