Skip to content

Commit 421971d

Browse files
committed
🎨 style: improve code formatting and style
1 parent ac66e99 commit 421971d

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/services/import.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ impl<'a> ImportService<'a> {
368368
if let Some(first) = record.get(0) {
369369
let first = first.trim();
370370
// Try to parse as a date - if it succeeds, this is data not a header
371-
let date_formats = [
372-
"%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d/%m/%Y", "%d/%m/%y",
373-
];
371+
let date_formats = ["%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d/%m/%Y", "%d/%m/%y"];
374372
for format in date_formats {
375373
if NaiveDate::parse_from_str(first, format).is_ok() {
376374
return true;

src/tui/handler.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,16 @@ fn handle_dialog_key(app: &mut App, key: KeyEvent) -> Result<()> {
855855
/// Execute an action after user confirmation
856856
fn execute_confirmed_action(app: &mut App, message: &str) -> Result<()> {
857857
// Bulk delete transactions
858-
if message.contains("Delete") && message.contains("transaction") && !app.selected_transactions.is_empty() {
858+
if message.contains("Delete")
859+
&& message.contains("transaction")
860+
&& !app.selected_transactions.is_empty()
861+
{
859862
let transaction_ids = app.selected_transactions.clone();
860863
let mut deleted_count = 0;
861864
let mut error_count = 0;
862865

863866
for txn_id in &transaction_ids {
864-
if let Err(_) = app.storage.transactions.delete(*txn_id) {
867+
if app.storage.transactions.delete(*txn_id).is_err() {
865868
error_count += 1;
866869
} else {
867870
deleted_count += 1;
@@ -873,7 +876,10 @@ fn execute_confirmed_action(app: &mut App, message: &str) -> Result<()> {
873876
app.multi_select_mode = false;
874877

875878
if error_count > 0 {
876-
app.set_status(format!("Deleted {} transaction(s), {} failed", deleted_count, error_count));
879+
app.set_status(format!(
880+
"Deleted {} transaction(s), {} failed",
881+
deleted_count, error_count
882+
));
877883
} else {
878884
app.set_status(format!("Deleted {} transaction(s)", deleted_count));
879885
}

0 commit comments

Comments
 (0)