4XK34NNIRSRK2C654MECVG27WSLH3NIP4334D3KRTW4Q3Y7ECIBAC
let (account_number, _) = record[1].split_once(" / ")?;
let Ok(account_number) = Iban::from_str(account_number) else {
let Some((account_number, _)) = record[1].split_once(" / ") else {
tracing::debug!(
account_number = &record[1],
"unexpected account number format: no separator"
);
let Ok(from_date) = Date::parse(&record[1], DATE_FORMAT) else {
return None;
let from_date = match Date::parse(&record[1], DATE_FORMAT) {
Ok(from_date) => from_date,
Err(error) => {
tracing::debug!(
%error,
from_date = &record[1],
"unexpected date format for from date"
);
return None;
}
let Ok(to_date) = Date::parse(&record[1], DATE_FORMAT) else {
return None;
let to_date = match Date::parse(&record[1], DATE_FORMAT) {
Ok(to_date) => to_date,
Err(error) => {
tracing::debug!(
%error,
to_date = &record[1],
"unexpected date format for to date"
);
return None;
}
let Ok(final_balance) = parse_german_amount(&record[1]) else {
return None;
let final_balance = match parse_german_amount(&record[1]) {
Ok(final_balance) => final_balance,
Err(error) => {
tracing::debug!(
%error,
balance = &record[1],
"unexpected format for closing balance",
);
return None;
}