From 5744ae4d774ff4eb1edf7ec4dbfd9af166b2e2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Sun, 29 Jun 2025 10:25:07 +0200 Subject: [PATCH] FIX: Cargo fmt --- base/src/expressions/lexer/mod.rs | 4 +--- base/src/expressions/lexer/ranges.rs | 5 +++-- base/src/functions/text.rs | 4 +--- xlsx/src/export/doc_props.rs | 6 +----- xlsx/src/import/worksheets.rs | 8 ++------ 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/base/src/expressions/lexer/mod.rs b/base/src/expressions/lexer/mod.rs index 4ebfd90..50152f1 100644 --- a/base/src/expressions/lexer/mod.rs +++ b/base/src/expressions/lexer/mod.rs @@ -572,9 +572,7 @@ impl Lexer { } self.position = position; match chars.parse::() { - Err(_) => { - Err(self.set_error(&format!("Failed to parse to double: {chars}"), position)) - } + Err(_) => Err(self.set_error(&format!("Failed to parse to double: {chars}"), position)), Ok(v) => Ok(v), } } diff --git a/base/src/expressions/lexer/ranges.rs b/base/src/expressions/lexer/ranges.rs index a574942..63bf98b 100644 --- a/base/src/expressions/lexer/ranges.rs +++ b/base/src/expressions/lexer/ranges.rs @@ -148,8 +148,9 @@ impl Lexer { let row_left = match row_left.parse::() { Ok(n) => n, Err(_) => { - return Err(self - .set_error(&format!("Failed parsing row {row_left}"), position)) + return Err( + self.set_error(&format!("Failed parsing row {row_left}"), position) + ) } }; let row_right = match row_right.parse::() { diff --git a/base/src/functions/text.rs b/base/src/functions/text.rs index d681a68..d2f41a7 100644 --- a/base/src/functions/text.rs +++ b/base/src/functions/text.rs @@ -84,9 +84,7 @@ impl Model { CalcResult::String(value) => { result = format!("{result}{value}"); } - CalcResult::Number(value) => { - result = format!("{result}{value}") - } + CalcResult::Number(value) => result = format!("{result}{value}"), CalcResult::Boolean(value) => { if value { result = format!("{result}TRUE"); diff --git a/xlsx/src/export/doc_props.rs b/xlsx/src/export/doc_props.rs index 2c885d2..0707da7 100644 --- a/xlsx/src/export/doc_props.rs +++ b/xlsx/src/export/doc_props.rs @@ -37,11 +37,7 @@ pub(crate) fn get_core_xml(workbook: &Workbook, milliseconds: i64) -> Result s, - None => { - return Err(XlsxError::Xml(format!( - "Invalid timestamp: {milliseconds}" - ))) - } + None => return Err(XlsxError::Xml(format!("Invalid timestamp: {milliseconds}"))), }; let last_modified = dt.format("%Y-%m-%dT%H:%M:%SZ").to_string(); Ok(format!( diff --git a/xlsx/src/import/worksheets.rs b/xlsx/src/import/worksheets.rs index de7a048..f3e0bd9 100644 --- a/xlsx/src/import/worksheets.rs +++ b/xlsx/src/import/worksheets.rs @@ -407,9 +407,7 @@ fn get_cell_from_excel( "empty" => Cell::EmptyCell { s: cell_style }, _ => { // error - println!( - "Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}" - ); + println!("Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}"); Cell::ErrorCell { ei: Error::ERROR, s: cell_style, @@ -496,9 +494,7 @@ fn get_cell_from_excel( } _ => { // error - println!( - "Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}" - ); + println!("Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}"); let o = format!("{sheet_name}!{cell_ref}"); let m = Error::ERROR.to_string(); Cell::CellFormulaError {