aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-09-14 14:44:06 -0400
committerJesse Luehrs <doy@tozt.net>2019-09-14 14:44:06 -0400
commit706172677867d4f31ab7394013335e865bd14866 (patch)
treee3a1195302f8cf83b90c5d9e8e0f08b4cdef3651 /src
parent200e668210f091bfc5e61efed28033b6da92015f (diff)
downloadynab-export-706172677867d4f31ab7394013335e865bd14866.tar.gz
ynab-export-706172677867d4f31ab7394013335e865bd14866.zip
bump ynab_api
Diffstat (limited to 'src')
-rw-r--r--src/main.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 965467a..5b8449e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -283,7 +283,10 @@ fn main() {
.memo
.unwrap_or_else(|| "\\N".to_string())
.as_ref(),
- scheduled_transaction.flag_color.as_ref(),
+ scheduled_transaction
+ .flag_color
+ .unwrap_or_else(|| "\\N".to_string())
+ .as_ref(),
scheduled_transaction.account_id.as_ref(),
scheduled_transaction
.payee_id
@@ -292,11 +295,16 @@ fn main() {
// the split category doesn't appear to be in the categories
// data, so we have to exclude it or else the NOT NULL
// constraint will fail
- if scheduled_transaction.category_id == SPLIT_CATEGORY_ID {
- "\\N"
+ if scheduled_transaction.category_id
+ == Some(SPLIT_CATEGORY_ID.to_string())
+ {
+ "\\N".to_string()
} else {
- scheduled_transaction.category_id.as_ref()
- },
+ scheduled_transaction
+ .category_id
+ .unwrap_or_else(|| "\\N".to_string())
+ }
+ .as_ref(),
scheduled_transaction
.transfer_account_id
.unwrap_or_else(|| "\\N".to_string())
@@ -330,7 +338,10 @@ fn main() {
.payee_id
.unwrap_or_else(|| "\\N".to_string())
.as_ref(),
- scheduled_subtransaction.category_id.as_ref(),
+ scheduled_subtransaction
+ .category_id
+ .unwrap_or_else(|| "\\N".to_string())
+ .as_ref(),
scheduled_subtransaction
.transfer_account_id
.unwrap_or_else(|| "\\N".to_string())