Fix clippy warnings
This commit is contained in:
@@ -148,6 +148,7 @@ mod tests {
|
|||||||
- Use `cargo fmt` for formatting
|
- Use `cargo fmt` for formatting
|
||||||
- Use `cargo clippy` for linting
|
- Use `cargo clippy` for linting
|
||||||
- Ensure documentation for public APIs
|
- Ensure documentation for public APIs
|
||||||
|
- _ALWAYS_ format and lint after making a change, and fix the linting errors
|
||||||
|
|
||||||
### 4. Commit Standards
|
### 4. Commit Standards
|
||||||
- Commit both code and tests together
|
- Commit both code and tests together
|
||||||
|
|||||||
@@ -119,15 +119,14 @@ impl TransactionSource for GoCardlessAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Optimization: Stop if we found all wanted accounts
|
// Optimization: Stop if we found all wanted accounts
|
||||||
if let Some(_) = wanted_set {
|
if wanted_set.is_some()
|
||||||
if found_count >= target_count && target_count > 0 {
|
&& found_count >= target_count && target_count > 0 {
|
||||||
info!("Found all {} wanted accounts. Stopping search.", target_count);
|
info!("Found all {} wanted accounts. Stopping search.", target_count);
|
||||||
return Ok(accounts);
|
return Ok(accounts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
info!("Found {} matching accounts in GoCardless", accounts.len());
|
info!("Found {} matching accounts in GoCardless", accounts.len());
|
||||||
Ok(accounts)
|
Ok(accounts)
|
||||||
|
|||||||
@@ -166,8 +166,7 @@ async fn process_single_account(
|
|||||||
if dry_run {
|
if dry_run {
|
||||||
info!("[DRY RUN] Would create transaction {}", tx.internal_id);
|
info!("[DRY RUN] Would create transaction {}", tx.internal_id);
|
||||||
stats.created += 1;
|
stats.created += 1;
|
||||||
} else {
|
} else if let Err(e) = destination.create_transaction(&dest_id, &tx).await {
|
||||||
if let Err(e) = destination.create_transaction(&dest_id, &tx).await {
|
|
||||||
// Firefly might still reject it as duplicate if hash matches, even if we didn't find it via heuristic
|
// Firefly might still reject it as duplicate if hash matches, even if we didn't find it via heuristic
|
||||||
// (unlikely if heuristic is good, but possible)
|
// (unlikely if heuristic is good, but possible)
|
||||||
let err_str = e.to_string();
|
let err_str = e.to_string();
|
||||||
@@ -184,7 +183,6 @@ async fn process_single_account(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(stats)
|
Ok(stats)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user