FIX: Cargo fmt

This commit is contained in:
Nicolás Hatcher
2025-06-29 10:25:07 +02:00
committed by Nicolás Hatcher Andrés
parent 0be7d9b85a
commit 5744ae4d77
5 changed files with 8 additions and 19 deletions

View File

@@ -572,9 +572,7 @@ impl Lexer {
} }
self.position = position; self.position = position;
match chars.parse::<f64>() { match chars.parse::<f64>() {
Err(_) => { Err(_) => Err(self.set_error(&format!("Failed to parse to double: {chars}"), position)),
Err(self.set_error(&format!("Failed to parse to double: {chars}"), position))
}
Ok(v) => Ok(v), Ok(v) => Ok(v),
} }
} }

View File

@@ -148,8 +148,9 @@ impl Lexer {
let row_left = match row_left.parse::<i32>() { let row_left = match row_left.parse::<i32>() {
Ok(n) => n, Ok(n) => n,
Err(_) => { Err(_) => {
return Err(self return Err(
.set_error(&format!("Failed parsing row {row_left}"), position)) self.set_error(&format!("Failed parsing row {row_left}"), position)
)
} }
}; };
let row_right = match row_right.parse::<i32>() { let row_right = match row_right.parse::<i32>() {

View File

@@ -84,9 +84,7 @@ impl Model {
CalcResult::String(value) => { CalcResult::String(value) => {
result = format!("{result}{value}"); result = format!("{result}{value}");
} }
CalcResult::Number(value) => { CalcResult::Number(value) => result = format!("{result}{value}"),
result = format!("{result}{value}")
}
CalcResult::Boolean(value) => { CalcResult::Boolean(value) => {
if value { if value {
result = format!("{result}TRUE"); result = format!("{result}TRUE");

View File

@@ -37,11 +37,7 @@ pub(crate) fn get_core_xml(workbook: &Workbook, milliseconds: i64) -> Result<Str
let seconds = milliseconds / 1000; let seconds = milliseconds / 1000;
let dt = match DateTime::from_timestamp(seconds, 0) { let dt = match DateTime::from_timestamp(seconds, 0) {
Some(s) => s, Some(s) => s,
None => { None => return Err(XlsxError::Xml(format!("Invalid timestamp: {milliseconds}"))),
return Err(XlsxError::Xml(format!(
"Invalid timestamp: {milliseconds}"
)))
}
}; };
let last_modified = dt.format("%Y-%m-%dT%H:%M:%SZ").to_string(); let last_modified = dt.format("%Y-%m-%dT%H:%M:%SZ").to_string();
Ok(format!( Ok(format!(

View File

@@ -407,9 +407,7 @@ fn get_cell_from_excel(
"empty" => Cell::EmptyCell { s: cell_style }, "empty" => Cell::EmptyCell { s: cell_style },
_ => { _ => {
// error // error
println!( println!("Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}");
"Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}"
);
Cell::ErrorCell { Cell::ErrorCell {
ei: Error::ERROR, ei: Error::ERROR,
s: cell_style, s: cell_style,
@@ -496,9 +494,7 @@ fn get_cell_from_excel(
} }
_ => { _ => {
// error // error
println!( println!("Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}");
"Unexpected type ({cell_type}) in {sheet_name}!{cell_ref}"
);
let o = format!("{sheet_name}!{cell_ref}"); let o = format!("{sheet_name}!{cell_ref}");
let m = Error::ERROR.to_string(); let m = Error::ERROR.to_string();
Cell::CellFormulaError { Cell::CellFormulaError {